You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
743 B
Python
28 lines
743 B
Python
# Import the package and create an audio effects chain function.
|
|
from pydub import AudioSegment
|
|
from pysndfx import AudioEffectsChain
|
|
import sys
|
|
|
|
|
|
mp3_audio = AudioSegment.from_file(sys.argv[1], format="mp3")
|
|
mp3_audio.export("../uploads/5/page_echo.wav", format="wav")
|
|
|
|
|
|
infile = '../uploads/5/page_echo.wav'
|
|
outfile = '../uploads/5/out.wav'
|
|
|
|
# Apply phaser and reverb directly to an audio file.
|
|
#fx(infile, outfile)
|
|
AudioEffectsChain().reverb()(infile, outfile)
|
|
|
|
# Or, apply the effects directly to a ndarray.
|
|
#from librosa import load
|
|
#y, sr = load(infile, sr=None)
|
|
#y = fx(y)
|
|
|
|
# Apply the effects and return the results as a ndarray.
|
|
#y = fx(infile)
|
|
|
|
# Apply the effects to a ndarray but store the resulting audio to disk.
|
|
#fx(x, outfile)
|