Let's write code to add an echo effect to an input audio. The code is very similar to the one in the AudioEffects.py
file discussed in earlier section. Just to simplify the matter, we will use the code in file EchoEffect.py
file for easier understanding. Later, you can easily integrate this with the code in AudioEffects.py
.
Download the file
EchoEffect.py
that has the source code to add audio echo effect. The file contains classAudioEffects
whose constructor has the following code.def __init__(self): self.is_playing = False # Flag used for printing purpose only. self.error_msg = '' #the flag that determines whether to use # a gst Controller object to adjust the # intensity of echo while playing the audio. self.use_echo_controller = False self.inFileLocation = "C:/AudioFiles/audio1.mp3" self.outFileLocation = "C:/AudioFiles/audio1_out.mp3" self.constructPipeline() self.connectSignals()
It is similar to the...