IOError: [Errno 2] No such file or directory



Hello, I’d like to play a sound from my workspace, I believe this is the correct path:


So I’m using pydub to play this:

song = AudioSegment.from_wav("/home/ubuntu/workspace/audio/test.wav")

The result is this error:

IOError: [Errno 2] No such file or directory: ‘home/ubuntu/workspace/audio/test.wav’

I saw a similar topic where a guy was reading a CSV but having the home path doesn’t make any difference. Am I structuring this path correctly?


Your pathing should be right, but looking through StackOverflow seems to suggest that the issue may be with pydub: . If you’re receiving a stack trace, you may want to check that to see if there’s a dependency that you may be missing.

Hope this helps!



As far as I can see the way I’m implementing audio using python is a problem with a web app, I’ve reproduced this issue with a number of libraries on 3 different platforms. It has been suggested that I use HTML5 and jQuery to perform the same operations.