0

Play Wav/Mp3 through Voice Bonnet Speaker
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Re: Play Wav/Mp3 through Voice Bonnet Speaker

by mikeysklar on Tue Apr 13, 2021 1:34 pm

Well this all looks correct so far.

If you run into alsamixer and make the VoiceBonnet the default output device then you should be able to hear audio when running


Code: Select all | TOGGLE FULL SIZE
sudo aplay <wavfile>


If alsamixer does not resolve it then you will need to modify the /etc/asound.conf to use card 1 instead of 0.

Code: Select all | TOGGLE FULL SIZE
pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

mikeysklar
 
Posts: 4609
Joined: Mon Aug 01, 2016 8:10 pm

Re: Play Wav/Mp3 through Voice Bonnet Speaker

by piornet on Sat Apr 24, 2021 12:55 pm

So...should I do anything else, or...?

piornet
 
Posts: 11
Joined: Mon Mar 25, 2013 9:07 pm

Re: Play Wav/Mp3 through Voice Bonnet Speaker

by mikeysklar on Mon Apr 26, 2021 10:52 am

@piornet,

This all looks good so far. You are correctly seeing your sound card when running `aplay -l`.

You should be able to play and record sounds using these commands. You will need to a WAV file and adjust the name from my example of test.wav to your filename for the last two:

Code: Select all | TOGGLE FULL SIZE
speaker-test -c 2 -F S16_LE -r 48000 -D hw:1,0


Code: Select all | TOGGLE FULL SIZE
arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 test.wav


Code: Select all | TOGGLE FULL SIZE
aplay -D plughw:1,0 test.wav

mikeysklar
 
Posts: 4609
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.