TaylorSMarks / playsound

Pure Python, cross platform, single function module with no dependencies for playing sounds.
Other
517 stars 114 forks source link

Error 263 and 305 #98

Open Fusionlight13 opened 3 years ago

Fusionlight13 commented 3 years ago

Before this update, I've never had a problem running this script. After this new update, I've had a few errors always coming up. I completely fixed the problems by reverting back to 1.2.2. I'm afraid I can't be very specific because I don't want to undo the changes I just did to fix my problem after trying to find a solution for a very long time. I compared the old source code with the new one and I found that they are really quite different. I'm not very fluent in python per se, but I just wanted to point out that there is something major with this new rework.

aaknitt commented 3 years ago

I'm also seeing error 263 when playing a WAV file on Windows. Unable to play a WAV file more than once since the file doesn't get closed during the first call to playsound(). Confirmed that reverting to 1.2.2 resolves issue.

makwadajp commented 3 years ago

Yes same here on Windows using playsound 1.3.0 with the following code (not that there is a need to show a code to reproduce because it is simple enough):

import sys
from playsound import playsound
playsound(sys.argv[1])

I have the following directory structure:

and here are the results I get:

Execution Command Plays Audio? Error?
python usePlaysoundProblem.py "audio\\aiueo_kakikukeko.wav" Y Error 305 for command:
close "audio\\aiueo_kakikukeko.wav"
python usePlaysoundProblem.py "audio\aiueo_kakikukeko.wav" N Error 305 for command:
open "audio\aiueo_kakikukeko.wav"
Error 263 for command:
close "audio\aiueo_kakikukeko.wav"
python usePlaysoundProblem.py "audio/aiueo_kakikukeko.wav" N Error 263 for command:
open "audio/aiueo_kakikukeko.wav"
Error 263 for command:
close "audio/aiueo_kakikukeko.wav"
python usePlaysoundProblem.py "audio/kakikukeko.wav" Y
CodicePauperem commented 2 years ago

Can confirm this is still a problem under Windows 10 with Python 3.10.2 in a venv. 1.3.0 produced error 305 on attempted open with correct file path and error 263 when attempting to close. Reverting Playsound to 1.2.2 makes the affected code work instantly with no further errors. My target media is an MP3.

Ron-Gupta commented 2 years ago

Can confirm this is still a problem under Windows 10 with Python 3.10.2 in a venv. 1.3.0 produced error 305 on attempted open with correct file path and error 263 when attempting to close. Reverting Playsound to 1.2.2 makes the affected code work instantly with no further errors. My target media is an MP3.

Same happening to me.