Audio Setup
Make sure the MicroSD card is inserted into the Yun and it is powered on. Connect to the Yun with SSH and execute the following commands to install the audio drivers and software:opkg update
opkg install kmod-usb-audio
opkg install madplay
opkg install alsa-utils
Once the commands above are executed, connect the USB audio adapter or speakers to the Yun.
Flask Setup
Execute the following commands to prepare python to install the Flask web application framework:opkg install distribute
opkg install python-openssl
easy_install pip
Next execute the following command to create a directory on the SD card for storing python packages:
mkdir /mnt/sda1/python-packages
This folder will be used to install Flask and other python dependencies. By storing these dependencies on the SD card, there's less concern about using up the very limited storage space on the Yun (only 16 megabytes for the entire Linux installation!).
Execute the following command to install Flask:
pip install --target /mnt/sda1/python-packages flask
Finally update the system profile to set the PYTHONPATH environment variable to point at the python packages folder by executing:
echo "export PYTHONPATH=/mnt/sda1/python-packages" >> /etc/profile
Disconnect from the Yun's SSH session and reconnect again so the PYTHONPATH variable is set.
Software Install
Once the audio and Flask setup steps are complete, you can install the software for this project. While connected to the Yun over SSH, execute the following commands to download the software and unzip it on the SD card:opkg install unzip
cd /mnt/sda1
wget --no-check-certificate \
https://github.com/tdicola/YunSoundboard/archive/master.zip
unzip master.zip
The folder YunSoundboard-master should be created with the contents of the zip file that was downloaded.
To start the Flask application, execute the following commands:
cd /mnt/sda1/YunSoundboard-master
python Soundboard.py
After a few moments the Flask application should load, and you should see the following text:
* Running on http://0.0.0.0:5000/
* Restarting with reloader
If you see an error, make sure you've carefully followed all the above setup steps and try again.
Once the application is running, open a web browser from a computer or device on your network and access the URL http://arduino.local:5000/.
Note: If you've changed the name of your Yun, change 'arduino.local' in the URL to the name of your Yun with the .local extension. Also if you're using a device that doesn't support mDNS names in URLs (like Windows or Android), instead access http://ip_address_of_yun:5000/ where ip_address_of_yun is the IP address of the Yun. For example http://192.168.1.110:5000/ would be the URL if your Yun has an IP address of 192.168.1.110.
Press buttons on the web page to make the Arduino play sounds! You can press the STOP button to stop any sound that is playing.
Add Sounds
To add your own sounds to the soundboard you can copy MP3 files into the YunSoundboard-master/sounds folder. On Mac or Linux, use the scp tool to copy a file from your computer to the Yun by executing in a terminal:cd /path/to/folder/with/MP3s
scp file.mp3 [email protected]:/mnt/sda1/YunSoundboard-master/sounds/
If necessary, change arduino.local to the name or IP address of your Yun.
On Windows you'll need to install the pscp utility. The syntax should be the same as the Mac/Linux command above, except with the 'pscp' command instead of scp. See these instructions for using pscp if you need more help.
Once the sounds are copied over, reload the web page and you should see them added to the list of sounds automatically.
Here are some sources of free sound effect MP3s:
Remember, you can only use MP3 files with the software.
Page last edited April 30, 2014
Text editor powered by tinymce.