Im have syntax error in def reverse app.route i know there is something wrong with getAudio but i dont know what. Here is example from pydub documentation
sound1 = AudioSegment.from_file("/path/to/sound.wav",
format="wav")
And heres part of my code, commented
@app.route('/Path/<filename>')
def getFilePath(filename):
return os.path.join(os.path.dirname(__file__), 'files', filename)
@app.route('/Audio/<filename>')
def getAudio(filename):
return AudioSegment.from_file(getFilePath(filename, format="wav")
@app.route('/rev/<filename>')
def reverse(filename):
song = getAudio(filename)
song = song.reverse()
Looks like you're missing a parenthesis.