4br3mm0rd / mpyg321

mpg321 wrapper for python - command line mp3 player
MIT License
22 stars 5 forks source link

Doesn't handle non-existent files. #3

Closed ghost closed 3 years ago

ghost commented 3 years ago

As the title says. If you try to run basic.py in the examples directory without a sample.mp3 file present, nothing happens. There is no error handling and no file checking to check if the file actually exists. I'm not sure if this is intended as a feature, so I'm raising this as an issue first before I make a pull request.

ghost commented 3 years ago

By the way, here's what happens when mpg123 tries to load an MP3 file which doesn't exist:

> mkdir test
> cd test
> ls
> mpg123 -R
@R MPG123 (ThOr) v8
L sample.mp3
main: [src/mpg123.c:738] error: Cannot open sample.mp3: File access error. (code 22)
@E Error opening stream: sample.mp3
@P 0
Q
> exit

I don't know the specifics for mpg321 but I imagine it'll be pretty similar.