Python Forum
pygame.mixer.init() devicename issue - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: pygame.mixer.init() devicename issue (/thread-21086.html)



pygame.mixer.init() devicename issue - wanhr - Sep-13-2019

Hi everyone:
I tried to use pygame to play a sound file on the raspberry pi with respeaker hat on it. I tried to specify the respeaker's ac101 to be the sound device using: pygame.mixer.init(frequency=48000,channels=1,buffer=4096,devicename='ac101'), but I got an error: "pygame.error: Couldn't find any hardware audio formats". I then clear the parameters and pygame.mixer.init(), the error still exist.

Do anyone have encountered this issue before? Could u help me?

PS: I am using Raspberry pi 3B with Respeaker 4 mic linear array, and pygame version is 2.0.0.dev1


RE: pygame.mixer.init() devicename issue - metulburr - Sep-13-2019

It could be SDL failing to open the audio file.

(Sep-13-2019, 08:33 AM)wanhr Wrote: and pygame version is 2.0.0.dev1
Why are you using a dev branch? The latest version i see is pygame 1.9.6


RE: pygame.mixer.init() devicename issue - wanhr - Sep-15-2019

(Sep-13-2019, 10:54 AM)metulburr Wrote: It could be SDL failing to open the audio file.

(Sep-13-2019, 08:33 AM)wanhr Wrote: and pygame version is 2.0.0.dev1
Why are you using a dev branch? The latest version i see is pygame 1.9.6

thank u for replying metulburr, I use the dev branch because I found the doc page of pygame is 2.0.0.dev3 and tried to follow the latest. And I want to use the parameter of devicename in pygame.mixer.init() to specify the audio device, I am not sure if there is devicename in other version of pygame.

I have solved the problem by changing another piece of Raspberry pi, because in the ealier time that day I somehow broke default sound card of that Raspberry pi...