![RoboBloX](../images/titles/roboblocks.gif)
BeepBlock FX
+ ![MemoryBloX](../images/roboblocks/260_MemoryBlock/MemoryBlock.jpg)
Theory
To produce sounds (other than beeps/tones) such as recordings, music, and voice requires
a MemoryBloX (SD card) connected to the BrainBloX
Audio files can take up a lot of memory. The BrainBloX (Arduino Nano) only has 30720 bytes (30KB) of program memory.
Uncompressed CD quality (44,100Hz) stereo audio requires about 176,400 bytes per second (176KB/s)
We can reduce the quality of the audio to save memory (and make it easier for our robot to process).
Switching from Stereo to Mono we cut the amount of data in half.
We then resample the audio at only 31,250Hz and switch from 16 bit to 8 bit.
This gets us 31,250 bytes per second (31KB/s)
This is about 5 times smaller than CD audio.
But even if we wiped out everything in our robot’s memory, there would only be enough room for 1 second of audio (and not any room left-over for the program to know how to play it!)
With a 256MB SD Card, you can store about 2 hours of audio!
Audacity Instructions
![Audacity](../images/logos/others/Audacity_Logo_With_Name.png)
First we must setup Audacity to record with settings our BeepBloX can play
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-08.jpg)
Change recording type from Stereo to Mono
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-04.jpg)
Change the project rate (bottom left of the screen) to 32000 Hz
The actual value is 31250 (but 32000 is close enough)
![Mic](../images/roboblocks/070_BeepBlock/Audacity-11.jpg)
![Record](../images/roboblocks/070_BeepBlock/Audacity-10.jpg)
Make sure your Microphone is turned up lound enough (but not too loud)
Then press the record button
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-09.jpg)
You can check that you got the settings correct by looking at the track
info
![Name](../images/roboblocks/070_BeepBlock/Audacity-13.jpg)
To keep track of all your recordings it may help you to give them a name
Click on "Audio Track", then choose "Name..." from the menu
Give it a name to help you remember which track it is
![Mute](../images/roboblocks/070_BeepBlock/Audacity-12.jpg)
Before you record another track you want to make sure all the other tracks you have are Muted
so they don't play while you record
![Rewind](../images/roboblocks/070_BeepBlock/Audacity-15.jpg)
Press rewind before recording a new track
![Tracks](../images/roboblocks/070_BeepBlock/Audacity-14.jpg)
Record as many tracks you want
![Delete](../images/roboblocks/070_BeepBlock/Audacity-16.jpg)
You can delete any tracks you don't want by clicking the X on the track
- Once you have recorded all the tracks you want
You can start exporting them as Sound Wave files...
![Select](../images/roboblocks/070_BeepBlock/Audacity-18.jpg)
Select the track you want to save
by clicking
anywhere in the track info area
this will select (highlight) the entire track
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-05.jpg)
From the menu at the top of the screen
Choose "File" then "Export Selected Audio..."
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-06.jpg)
If needed change the Save as type:
"Other uncompressed files"
![Type](../images/roboblocks/070_BeepBlock/Audacity-06b.jpg)
If needed change the Header:
"WAV (Microsoft)"
![Encoding](../images/roboblocks/070_BeepBlock/Audacity-06c.jpg)
If needed change the Encoding:
"Unsigned 8-bit PCM"
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-07.jpg)
Files must be saved as:
"Other uncompressed files"
"WAV (Microsoft)"
"Unsigned 8-bit PCM"
![File](../images/roboblocks/070_BeepBlock/Audacity-17a.jpg)
Give your file a name
Save it somewhere you can find it
(Desktop or Music folder)
FILE NAME RULES:
1) Max 8 characters long
2) No spaces
3) Only Letter and Numbers
(UPPER/lower case doesn't matter)
4) End with .WAV
![SD](../images/roboblocks/260_MemoryBlock/MemoryBloX-000.jpg)
![SD](../images/roboblocks/260_MemoryBlock/MemoryBloX-001.jpg)
Place SD card into the USB card adapter
Plug adapter into your computer
Copy the file to your SD Card
Do NOT rename, delete, or overwrite files!
If you do, you must format (not fast-format) the SD card to erase everything on it.
![SD](../images/roboblocks/260_MemoryBlock/MemoryBloX-002.jpg)
![SD](../images/roboblocks/260_MemoryBlock/MemoryBloX-003.jpg)
![SD](../images/roboblocks/260_MemoryBlock/MemoryBloX-005.jpg)
Place the SD card back into your card reader
(It clicks in and out like clicking a pen)
Converting Imported Sound Effects Files or Songs
- To add a file:
Drag and drop the file into Audacity
or
File -> Import -> Audio...
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-01.jpg)
Covert the track to Mono
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-02.jpg)
![Audacity](../images/roboblocks/070_BeepBlock/Audacity-03.jpg)
Resample the track to 31250 Hz (or 32000 Hz)
- Now you can follow the normal instructions for exporting this track