1

I have recorded two people speaking on two different channels. However, they are close enough that you can hear both people on both channels albeit at different volum.

I used pydub to split this into second long intervals and display the dBFS. It's pretty clear to see where the first person is speaking.

Is there a way I can mute all audio below some threshold? For instance, I'd like to hear the audio with everything below -5 dBFS taken out.

m4a_audio = AudioSegment.from_file('myfile.m4a', format = 'm4a')
split_audio = m4a_audio.split_to_mono()
channel_0_splits = split_audio[0][::1000]
spliced_dbfs = [splice.max_dBFS for splice in channel_0_splits]
plt.plot(spliced_dbfs)

enter image description here

user1357015
  • 11,168
  • 22
  • 66
  • 111
  • 1
    The specific effect you're looking for, in general audio terms, is a [noise gate](https://en.wikipedia.org/wiki/Noise_gate). – Random Davis May 03 '21 at 19:22
  • 1
    @RandomDavis: Yep, that looks just right, thanks! I've been trying to find this in python with little success. Any suggestioins? – user1357015 May 03 '21 at 20:00
  • 1
    Not really, but I figured that that would be a good starting point to look at existing implementations, and see if it's something you could accomplish with existing features in PyDub or something related. For instance, a noise gate is usually implemented via an Expander (the opposite of a compressor), so you could look into seeing if there's an existing implementation of an expander in PyDub, and tweak that until it functions as a noise gate for your particular case. – Random Davis May 03 '21 at 20:10

0 Answers0