belangeo / pyo

Python DSP module
GNU Lesser General Public License v3.0
1.28k stars 130 forks source link

Doesn't run on Python 3.10 #235

Closed JourneyToSilius closed 2 years ago

JourneyToSilius commented 2 years ago

Any quick fix to make it run on a Python 3.10 env ?

ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/xavier/Code//bin/main.py", line 11, in <module>
    main()
  File "/home/xavier/Code//bin/main.py", line 8, in main
    bot.run_vocoder()
  File "/home/xavier/Code//src/bot/engine.py", line 71, in run_vocoder
    vocoder("./speech_audio/title_shifted")
  File "/home/xavier/Code//src/utils/audio_conversion.py", line 48, in vocoder
    spktrm = SfPlayer(src, speed=[1, 1.001], loop=True)
  File "/home/xavier/Code//venv/lib/python3.10/site-packages/pyo/lib/players.py", line 118, in __init__
    SfPlayer_base(
SystemError: <class '_pyo.SfPlayer_base'> returned a result with an exception set
belangeo commented 2 years ago

I added the PY_SSIZE_T_CLEAN macro a while ago, but maybe it's needed in every module using string format. I'll take a look...

belangeo commented 2 years ago

Fixed in 7aeb2e881bb841b44b4b7f8aa5d5f3707198b9ac. Will be in the next release.