|
|
Everything Else » SD card for PCM sound
| November 26, 2009 by pbfy0 |
I wrote a program for reading a SD card and playing the sound on it. It can also take sound from the computer over the UART and load it into the SD card. You send the nerdkit 'l' and then PCM data in binary. use libsndfile (compile & install) and pcm2nlsv to get PCM audio with values separated by newlines. Here's a pinout of a SD card
and the connections are this: I can't find the source right now, but I'll post it when I find it. |
|---|---|
| November 27, 2009 by pbfy0 |
I found the source, and I changed it so it takes a number in ASCII instead of bin. here it is. I'll make a perl script to send a file with PCM values separated by newlines, and post it when I'm done. |
| November 27, 2009 by pbfy0 |
Libsndfile should be here. |
| November 27, 2009 by pbfy0 |
I have the perl script, here, and I have the complete process for getting a wav file onto the chip. <infile> for sndfile-convert is any music file <outfile.raw> for sndfile-convert is <infile.raw> for pcm2nlsv <outfile> for pcm2nlsv is <infile> for sound.pl <port> for sound.pl is the serial port address. Only do steps 2 & 3 if you're repeating the sequence. Remember, the C program is UNTESTED. |
| November 29, 2009 by pbfy0 |
I noticed an error in the code, here's the fixed one. |
| March 09, 2010 by pbfy0 |
the SS pin on the connections table should be connected to SD pin 1 where it just says SD pin |
| March 20, 2010 by brian |
I thought SD cards ran off 3.3 volts, doesn't the NerdKit use 5V? |
| March 22, 2010 by pbfy0 |
the LD1086V33 is a 3.3 volt regulator, and the resistors regulate the data levels. |
Please log in to post a reply.