Skip to content

Commit

Permalink
don't adjust volume per channel
Browse files Browse the repository at this point in the history
  • Loading branch information
slowriot committed Jan 2, 2025
1 parent f58fc5e commit 19dfdf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ void game_manager::audio_generator::output(std::span<AudioSampleFrame> outputs)
// produce a sine wave tone of desired frequency to all output channels
for(auto const &output : outputs) {
for(int i{0}; i != output.samplesPerChannel; ++i) {
float s{static_cast<float>(std::sin(phase))};
float const sample{static_cast<float>(std::sin(phase)) * current_volume};
phase += phase_increment;
for(int channel{0}; channel != output.numberOfChannels; ++channel) {
output.data[channel * output.samplesPerChannel + i] = s * current_volume;
output.data[channel * output.samplesPerChannel + i] = sample;
}
}
}
Expand Down

0 comments on commit 19dfdf8

Please sign in to comment.