Pysoundcard currently doesn't play sound from file, pull request with fix submitted #1299
Hey guys, here the text of the pull request I submitted which just about says it all:
I'm definitely not a master of audio programming, but I was able to get a sound file to play by making these changes.
The original error was from line 425, and was complaining that there is no attribute for "status":
In soud.py, the comment in _setSndFromArray (about line 434) indicates that it is the function that will ultimately get called for pysoundcard, and the _setSndFromFile wasn't ever calling it, hence self._snd was still None, and the module failed to load correctly (see line 174 also, it seems like there is an error that should have been called since self._snd is None?):
Therefore, my fix was to call _setSndFromArray from within _setSndFromFile. I also changed sndArray to be a local variable (removed self.), since this value would be set in _setSndFromArray . I can now play sound files. Please let me know if you have any comments.
Here's the pull request.
In the process, I found that there was a bug in pysoundfile (not sure if linux specific), that they fixed about a week ago, but which is apparently not in the pip repos. I'll make a separate issue for this.
The text was updated successfully, but these errors were encountered: