0

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()   
Ivan
  • 37
  • 7

1 Answers1

1
return AudioSegment.from_file(getFilePath(filename, format="wav")

Looks like you're missing a parenthesis.

return AudioSegment.from_file(getFilePath(filename), format="wav")
Kevin
  • 74,910
  • 12
  • 133
  • 166
  • Wow i was checking like 3 times, im sorry for wasting your time and thank you a lot. im gonna accept this as answer as soon possible. – Ivan Jun 09 '15 at 15:57