I would like to generate workout mp3 file with music in the background and instructions at some timing (ex. "push harder", "do another repetition !")
I generate the instruction with pico2wave and assemble them with pydub.
I do this :
for timing,phrase in phrases.items():
fileToAdd = pydub.AudioSegment.from_file(rep+"/"+str(timing)+".wav")
finalFile = finalFile.fade(to_gain=-35, start=(timing*1000)-500, duration=500) # on diminue la chanson, une demi seconde avant
finalFile = finalFile.fade(to_gain=+35, start=(timing*1000)+len(fileToAdd), duration=500)
fichierFinal = fichierFinal.overlay(fileToAdd,position=timing*1000)
The result file has a VERY bad quality. I try to remove the "fade effect" and the quality is good (but I don't hear very well the "instructions")
How can I change this ? Can I easily make a fade out and fade in effect ?
Thank you,
Regards,
Axel