Playing sound files on the Debian Slug
Objective
1) Have the Slug report temperatures etc verbally
2) Perhaps play music from a list
I use this USB sound device - Listed on eBay UK as
"USB 2.0 3D AUDIO SOUND CARD ADAPTER FOR PC / LAPTOP UK"
About £3.50 including postage - UK sourced.
There are many complex "help" pages on the Net that assume you
are expert in Linux. However the following seems to be sufficient.
The driver for the above USB device is built in - It is recognised by the system.
To Play .wav files
On a terminal type -
apt-get install alsa-utils
apt-get install alsa-base
aplay 100.wav 30.wav 8.wav - this plays the 3 wav files in sequence
or -
apt-get install sox
play soundfile.wav
To play MP3 files
madplay
apt-get install madplay
madplay soundfile.mp3
mpg123
apt-get install mpg123
mpg123 Chantilly_Lace.mp3
mplayer plays .wav files but not MP3
MOC Music on Console
apt-get install moc
mocp loads the screen into the terminal display (ssh not ttyS0 on RS232)
it says it needs ncurses - not sure if it loads ncurses itself
I did apt-get install libncurses5-dev
Not sure now which added ncurses... - but it is present
The ssh terminal screen is almost GUI - easy navigation and play
Text to speech - "flite"
apt-get install flite
flite -t "words to speak "
flite -t greenhouse
flite -t 4567
flite -t "hello my friend" -o hellofriend.wav
flite man pages - contain -
Options
--version
Output flite version number.
-?, --help
Output usage information.
-o WAVEFILE
Explicitly set output filename.
-f TEXTFILE
Explicitly set input filename.
-t TEXT
Explicitly set input text string.
-p PHONES
Explicitly set input text string and synthesize as phones.
-s, --set FEATURE=VALUE
Set feature (guesses type).
--seti FEATURE=VALUE
Set int feature.
--setf FEATURE=VALUE
Set float feature.
--sets FEATURE=VALUE
Set string feature.
-b
Benchmark mode.
-l
Loop endlessly.
-v
Verbose output.
Text to speech - "espeak"
apt-get install espeak
espeak -h gets help
LKG8A6E00:/# espeak -s 140 "The greenhouse temperature is 45.6. It is very hot."
Expression 'ioctl( devHandle, SNDCTL_DSP_CHANNELS, &temp )' failed in 'src/hostapi/oss/pa_unix_oss.c', line: 390
despite the error it runs well "- s 140" sets speed a bit slower than the default 160