July 05, 2013 | Raspberry Pi |
This is a short post on getting audio setup on my Raspberry Pi and then making it speak.
For the audio setup, I followed instructions on this website:
After the above steps, the first time I plugged in a pair of powered speakers to the Pi, I got a whole bunch of "journal" errors from the kernel. Luckily, they went away after a reboot. I have to live with the fact that installing stuff on Linux will always be a "transcendental" experience for me. ;-)
To test audio, you can try:
Once you are happy with this, the next step is to install pyttsx, which is a Python text-to-speech library. You can install it as follows:
tar -xf pyttsx-1.1.tar
sudo python setup.py install
In addition to the above, I also needed to install espeak, which I did as follows:
sudo apt-get install espeak
Now, to get some quality speech out of our Pi. Try the Python code below:
Need help with a hardware project or product? Drop us an email at firstname.lastname@example.org. We offer consulting services on AVR and Nordic nRF BLE - hardware design, firmware development, prototyping, PCB design/assembly, sourcing and manufacturing. We can help you bring your product to market!
We love hearing from our readers. Email us at email@example.com for questions or comments on this article. If you found this article useful, please support us by buying some of our hardware products.