pyminiaudio isn't usable with Cython because inspect.isgenerator on Cython generators isn't True
pyminiaudio isn't usable with Cython audio sources because inspect.isgenerator on Cython generators isn't True:
File "/home/user/.local/lib/python3.11/site-packages/miniaudio.py", line 1402, in start
raise TypeError("callback must be a generator", type(callback_generator))
TypeError: ('callback must be a generator', <class '_cython_3_0_3.generator'>)
It would be nice if this check could be expanded in a way that also supports Cython.
In pyminiaudio version 1.59, this problem still seems to be present if my tests are correct.
I know very little about cython.
Do you have any idea how to fix it, and/or how to test a potential fix?
Sadly, I don't know how to check this for Cython either. To be able to use miniaudio, I simply deleted that check on my local copy.
Ok that is interesting, this check is the only thing that prevents it from working in cython?
Yup! I use it from a Cython program just fine, passing in a Cython function to generate sound. But it only works if I remove that check.
I'll see what I can do about that, then.