If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Arduino to play the audio file in Zx Spectrum

Hi,
some time ago i remember someone here to talk about a circuit to read the audio from a tape into the ZX Spectrum
Well i am trying to do something similar:
I bought an small cricuit that has a sdcard slot and a 2.5 output jack. It reads mp3/wav files. The price is +/- 5 euros.
I am using the Arduino, i am using the UNO 3, but it can be done with the smaller one, the Nano. I connect the mp3 board to the Arduino, put a mp3 in the scard, and with some wire and programming i was able to play the mp3 and listen in headphones. It needs a 5v but with the Arduino nano it can be done with 3v. I will now put a LCD screen to see the name of the files in the sdcard, and some buttons to choose the file and play it.
Putting the ZX game file in mp3 or wav and connect the Arduino into the ZX, i think i can create a player for the ZX with a size smaller then a credit card. Total production cost should be around 20 euros.

The lcd needs a lot of iron solder to put all cables connected to the arduino.
The game will take the same time to load, but you can have all games in the sdcard. It is the same concept to the Amiga HXC, but simple to do it.
I am sure someone did this before, but it's quite fun to do it yourself.

The code is not that difficult. I was able to put it to play an mp3 and could do a play/pause with a input. It is easy to put a potentiometer to control volume. And 3 or 4 buttons to choose a file to play from the sdcard. this last part i need to read more about it.

check the base code:

/***********************************************************/
//Demo for the Serial MP3 Player by Catalex
//Hardware: Serial MP3 Player *1
//Board: Arduino UNO R3
//IDE: Arduino-1.0
//Function: To play the first song in the micro sd card.
//Store: http://www.aliexpress.com/store/1199788
// http://www.dx.com/
#include <SoftwareSerial.h>

#define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module
#define ARDUINO_TX 6//connect to RX of the module
SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX);

I just rename to avoid strange characters. Some readers tend to not recognize strange ascii symbols. But it can read long file names. But you can have any name in the mp3.
My test was with a hangar18_rust_in_peace_megadeth.mp3 or something like this. but it had same %$# symbols in the file name, so i remove those.

But:
- it has to be bellow 44kbs
- the sdcard must be bellow 2GB
- the scdard bus be FAT or FAT32

There are other cards that can read bigger cards and mp3 at 192kbs or higher but they are more expensive. For what i need i this one is enough.

I've ordered a couple along with Nanos and 1602's and made a proto board. I'm going to see which MSX games I can find which don't need Motor control and test it at the normal Arduitape frequency and then the standard cas2wav frequency to see how well the Wav playback is with the computer and then it's a case of rewriting the Arduitape software first to work with .WAV files and then to see if it will work converting as well.