If you just want an mp3 file on the SD card without any programming I advise you to copy the file to the card using a PC.
Other wise You are in for a lot of programming; MP3 encoding, connecting through the sd card @kennethlimcp, by means of the library written by @mdma, and so forth.
The idea work like voice message: voice to mp3, and mp3 to speaker.
So I want find way send and receive mp3 file with server. I find spark core support tcp, but good send string. If I need upload and download mp3 file, I think should use something like ftp?
@rhoulay, you could use a VS1053 breakout like this one:
The use of TCP is most likely the best interface for large data though packet sizes are limited to 1400 bytes or so. The VS1053 will compress the MIC audio but I am not sure it will store it on the SD card. There is a library for the VS1053 available though some members have reported issues with higher bitrates. You have your work cut out but I believe it is possible. Do a search in the Community for “VS1053” and you will find topics very similar to what you are looking for.
This is definitely do-able. I’ve done the same with downloading an image into flash and then displaying it on a display connected to the Core. I download over HTTP in “chunks” so all I have to do is host the image file on any normal web server. Would this work for you?
Hey, this code is crazy rough and not all of its actually there but the general gist is there. Read through it and ask any questions if you are unclear.
It downloads an image which is fixed @ 9600 bytes. As such, there’s only enough free space available for 80 “slots” for these images to be saved into external flash. A more flexible implementation would be nice but I simply haven’t had the time to write it.
Sure. Reply back which functions you need and I’ll gladly provide them. The DBG_* functions are just special Serial.print(…) statements which I constructed to make it easier to visualize what’s going on. You are also going to be missing a decent number of constants… I’ll just post the entire file tonight. I’ll update you when it’s there
@harrisonhjones, thanks for sharing! My troublemaker brain is wondering if a webhook could not be used to make the image request (non-local server) and get the data back as 512-byte chunks
Sorry, I wasnt clear on my question
I’m wondering why @harrisonhjones used http chunk encoding for the downloads. It seems like extra effort to chunk up the transfer like that.
@rsteckler, both the firmware and CC3000 have limited buffering space so chunking avoids buffer overflow issues, which on the CC3000 causes it to crash.