I am new to audio related programming in RPi. Following code works well and playing sound from a wav file in Python2.

import alsaaudio as aa

output = aa.PCM(type=aa.PCM_PLAYBACK, mode=aa.PCM_NORMAL, device='default', cardindex=-1)

But the same code throws error in Python 3.7.3 as follows: alsaaudio.ALSAAudioError: Invalid argument

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.