I test an example script for synthplayer module, examples/synth_demo.py, on macos, then I got the following message:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundcard/coreaudio.py", line 464, in init
raise TypeError("blocksize must be between {} and {}"
TypeError: blocksize must be between 14.0 and 512
After studying soundcard/synthplaer, I noticed that maxblcoksize of AudioUnit may be changed internally. So that requested blocksize may exceed the maxblocksize, then we will get the error message above. I modified soundcard/coreaudio.py slightly, shown below:
@@ -458,12 +458,14 @@
there are two maximum block sizes for some reason:
I test an example script for synthplayer module, examples/synth_demo.py, on macos, then I got the following message:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/soundcard/coreaudio.py", line 464, in init raise TypeError("blocksize must be between {} and {}" TypeError: blocksize must be between 14.0 and 512
After studying soundcard/synthplaer, I noticed that maxblcoksize of AudioUnit may be changed internally. So that requested blocksize may exceed the maxblocksize, then we will get the error message above. I modified soundcard/coreaudio.py slightly, shown below:
@@ -458,12 +458,14 @@
there are two maximum block sizes for some reason:
self.blocksizerange[1]))
@@ -585,6 +587,13 @@ _cac.kAudioUnitScope_Global, 0, "UInt32") assert maxblocksize return maxblocksize
Now I can run the synthplayer example script, synth_demo.py, with some parameter adjustment( params.norm_frames_per_chunk=1024) .
Thank you very much for make the nice program available to u.s.