Skip to content

Commit

Permalink
differentiable
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaschan committed Oct 18, 2023
1 parent 96b5c98 commit 4475cf7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,7 @@ impl AudioProcessor<'_> {
let volume = { *self.volume.lock().unwrap() };
if volume != 100 {
let mut audio_data = chunk.audio_data;
let volume_multiplier = if volume < 100 {
volume as f32 / 100.0
} else {
((volume as f32 / 100.0) - 1.0).exp()
};
let volume_multiplier = (volume as f32 / 100.0).exp2() - 1.0;
for sample in audio_data.iter_mut() {
*sample *= volume_multiplier;
}
Expand Down

0 comments on commit 4475cf7

Please sign in to comment.