For example, our demo can be installed as a public address system or even an accompanying audio announcement device with digital signage. The Raspberry Pi audio broadcasting service runs as a peer-to-peer application powered by PubNub Data Streams. On one end, we have the requester peer which sends a request for audio broadcast. The requester sends a text sentence within a PubNub payload and the broadcaster converts it to speech and sends it to the Raspberry Pi's audio output.Īnd on the other end, there is a broadcaster application running on the Raspberry Pi. We need to first setup the audio driver for Raspberry Pi. For this application, we are using a standard USB sound card which attaches to one of the USB ports of the Raspberry Pi. We'll be using a standard desktop speak from Lenovo, but feel free to use any speak system you want. Step 0: Software Installation and Driver Loading In our next step, we'll set up the sound device on the Raspberry Pi and direct the sound output to the USB sound card. Raspbian OS follows the Advanced Linux Sound Architecture (ALSA) for managing audio devices. Using the apt-get utility, install the following packages ( you will need admin privileges to install these packages) apt-get install alsa-utils apt-get install mpg321 apt-get install lame We have to install a few packages to test the sound device through ALSA. Load the sound driver as follows: modprobe snd-bcm2835 Step 1: Connect & Detect the Audio Hardware TEXT TO SPEECH RECORDER PCM INSTALL Make sure that the Raspberry Pi is powered off. Connect the USB sound card to one of the USB ports of the Pi and power on the Pi. Once the Raspbian OS has booted, make sure that the audio hardware has been detected. To check this, log on to the terminal (either through SSH or LXTerminal app) and issue the 'lsusb' command.Īs you can see, the last device listed in the USB port list is the audio sound card. ![]() Step 2: Enable USB Audio Device in ALSAīy default, the Raspberry Pi sound driver is configured to use a built in PCM audio device. ![]() The configuration file is located in the path: /etc/modprobe.d/nf As we are using the external USB audio card, we have to make a configuration setting to let the ALSA know about our external USB sound card. Open this file and change the value of snd-usb-audio index to 0. With the Raspberry Pi restarted, run the following command from the terminal prompt to see the current audio configuration: $ amixer Save the file and reboot Raspberry Pi for the new settings to take effect. Next, we need to select the audio output to be used by Raspberry Pi. Open up the raspi-config configuration tool from the command line and follow the below procedure: You will now notice a detailed information about the sound card capabilities including sound playback and sound capture. Select the menu sequence, "Advanced Options" > "Audio" and choose "Auto"Īfter selecting "Auto" mode, press the right arrow key to select button and exit the options list, then select "Finish" to exit the configuration tool. This will enable the Raspberry Pi to autodetect the sound output and use either HDMI or USB audio jack depending upon which one is connected. With the sound device setup, it's time to test the application. Aplay /usr/share/scratch/Media/Sounds/Vocals/Singer1.wav Connect the speakers to the speaker jack on the sound card and play one of the test sound files provided by Raspbian OS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |