I use Pydub Library. I want to mix 2 sounds with different decibel levels incorporating dB data (different energy level). For example, I have the sound of two species.
sound1 = AudioSegment.from_file("species_a.wav")
sound2 = AudioSegment.from_file("species_b.wav")
combined = sound1.overlay(sound2)
And I want, for example, species "a" speak up than species species "b" in my new sound "combined".
Do this with different energy level (-18 dB, -12 dB, -6dB,- 0dB).
It is possible ?
Thanks !
you can normalize them like (untested code, but it probably works)
def set_to_target_level(sound, target_level):
difference = target_level - sound.dBFS
return sound.apply_gain(difference)
sound1_adjusted = set_to_target_level(sound1, -12.0)
sound2_adjusted = set_to_target_level(sound2, -12.0)
combined = sound1_adjusted.overlay(sound2_adjusted)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With