1

I have some audio files.

I mixed audio files.

for idx,f in enumerate(files): if idx == 0: sound = pydub.AudioSegment.from_file(f) else: temp = pydub.AudioSegment.from_file(f) sound = sound.overlay(temp, position=0) sound.export("totakmix.wav",format="wav") 

Each audio file is not clipping.

However, mix file is clipping.

Is there any way to prevent this??

1 Answer 1

1

The easiest thing you can do to prevent clipping while using overlay is to apply negative gain correction with gain_during_overlay like this:

sound = sound.overlay(temp, position=0, gain_during_overlay=-3) 

to changes the audio by 3 dB while overlaying audio. Why 3 dB? It translates to roughly twice power gain, so if your original audio was not clipping, the end result should not either.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much. and nice explanation for 3db. it is quite helpful

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.