I have been trying to find a reliable method to play sound on my Pi Zero W, in Python. By default, Zero does not have audio output, but I have set up an I2S amp and speaker, following this guide: http://www.lucadentella.it/en/2017/04/26/raspberry-pi-zero-audio-output-via-i2s/
In general, the audio output is good. For example, I can use headless vlc player to stream audio from youtube or various internet radio stations.
But I was quite surprised the options are quite poor when you need to play sound from Python. Pyglet seems to be abandoned, at least the AVbin lib it relies on definately is. Launching an external player in separate process to play sounds might be acceptable for a "media player" application, but not reliable when you need to play little bits of sounds with precise timing. So a method more native to Python is sought.
Despite the load of heavy reference requirements, I've currently settled on pygame. But unfortunately it behaves bad, when the app has been running for long time. I've described symptoms here: https://stackoverflow.com/questions/54564107/pygame-mixer-music-ogg-playback-distorted-after-long-period-of-idling
If there are reliable alternative to pygame, I'd gladly use that. Currently I am stuck with pygame, that has this weird glitch, where the only workaround is to do secret re-initialisation at regular time intervals.