Compiling pyao with Python 3.11, and this example program, leads to an error at runtime:
$ python
Python 3.11.5 (main, Aug 29 2023, 15:31:31) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ao
>>> dev = ao.AudioDevice(0)
>>> with open('/home/jaq/bucket/buckaroo2.wav', 'rb') as f:
... dev.play(f.read())
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
https://docs.python.org/3/c-api/arg.html#strings-and-buffers indicates we should now be setting this in aomodule.h before Python.h is included.
We also then need to change len on aomodule.c:367 to be of type Py_ssize_t otherwise PyArg_ParseTuple does not decode the argument into &samples, returning a MemoryError from line 381.
Compiling pyao with Python 3.11, and this example program, leads to an error at runtime:
https://docs.python.org/3/c-api/arg.html#strings-and-buffers indicates we should now be setting this in aomodule.h before Python.h is included.
We also then need to change
lenon aomodule.c:367 to be of typePy_ssize_totherwisePyArg_ParseTupledoes not decode the argument into&samples, returning aMemoryErrorfrom line 381.