I'm using Raspberry Pi 3b, usb mic and 3.5mm audio jack as speaker. mic is hw:1,0; speaker is hw:0,0
Everything works fine except that I'm unable to get pygame.mixer.Sound.play()
in a python script to work.
Script:
import time
import pygame
pygame.init()
pygame.mixer.init()
sounda=pygame.mixer.Sound("test.wav")
sounda.play()
I get:
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
pygame.error: No available audio device
or MemoryError
However if I enter python2&3 environment then run the commands again, it worked fine... Appreciate the help.