Open iwat opened 2 years ago
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:
playsound.py
- 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.
byReference
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.
encodeWithCoder:
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
I was trying to write a Dropbox music player and hit this error:
For an unknown reason, I updated
playsound.py
and it is now working: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