playsound
playsound copied to clipboard
MacOS + URL got "Could not load sound with filename, although URL was good..."
I was trying to write a Dropbox music player and hit this error:
Could not load sound with filename, although URL was good... https://....
For an unknown reason, I updated playsound.py
and it is now working:
- nssound = NSSound.alloc().initWithContentsOfURL_byReference_(url, True)
+ nssound = NSSound.alloc().initWithContentsOfURL_byReference_(url, False)
This works for both local files and URLs. I'm not really sure what that byReference
actually is.
https://developer.apple.com/documentation/appkit/nssound/1477288-initwithcontentsofurl?language=objc
When YES only the name of the sound is stored with the NSSound instance when archived using
encodeWithCoder:
; otherwise the audio data is archived along with the instance.
did it for me. +1
worked for me too on macOS 13.0 on a M1 mac.
it didn't work for me tho. it kept showing the same error