Python Forum
pygame.mixer.init() devicename issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame.mixer.init() devicename issue
#1
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
Reply
#2
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
Recommended Tutorials:
Reply
#3
(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...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] mixer failing in 2.0 fmr300 5 4,887 Mar-15-2021, 06:16 PM
Last Post: BashBedlam
  [PyGame] Pygame : clearing a screen issue Reldaing 4 6,032 Jun-23-2020, 09:10 AM
Last Post: JudyLarose
  pygame why init() & not __init__()? ryfoa6 1 1,800 Apr-17-2020, 04:47 AM
Last Post: buran
  pygame.init help raichu4vuhs 2 5,862 May-18-2017, 08:33 PM
Last Post: kennybassett

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020