Sound installation
From Rsewiki
Back to Robobot.
Sound
festival
Easy understandable voice, but takes time to generate and require two intermediate files
sudo apt install festival echo "The brown fox jumps over lazy dog" > aaa.txt text2wave aaa.txt -o aaa.wav aplay aaa.wav
Music files
Play sound files, like
sudo apt-get install sox libsox-fmt-all play -v0.1 music.mp3
This line plays an mp3 file with volume reduced by a factor 0.1.
The at startup the blue button on the gamepad plays the file in /home/local/Music/music.mp3.
This is a symbolic link to some real music (Radetzky Marsch in this case):
ls ~/Music radetzky-marsch_Schloss-Schoenbrunn-Konzerte_Wien_full-length.mp3 cd ~/Music ln -s radetzky-marsch_Schloss-Schoenbrunn-Konzerte_Wien_full-length.mp3 music.mp3
The free music is found at https://www.imagevienna.com/fileadmin/mp3/radetzky-marsch_Schloss-Schoenbrunn-Konzerte_Wien_full-length.mp3
Sound level
On a Raspberry pi version 3+ (not tested on other versions)
$ amixer Simple mixer control 'PCM',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback -10239 - 400 Mono: Playback 400 [100%] [4.00dB] [on]
An thus:
Setting the sound level can be done by:
amixer set PCM 0dB unmute
Setting to maximum (100%) is about the same as setting 4dB (may be too much for amplifier).
amixer set PCM 100% unmute