Multiple MP3 modules

Steve2381

Senior Member
Hey all

I need a system where I can play multiple sound files at the same time (through a low quality mixer). Basically, I need a background 'engine' sfx, with other effects overlaid on top.

I am thinking of these:

http://www.ebay.co.uk/itm/291956275599

However, the cost jumps up pretty rapidly when you start to add in MicroSD cards.

Not knowing how it reads from the SD card (Google here I come)... is there any way I can get one of these modules to read a single MP3 file from a memory chip or something, instead of the SD card?
 

hippy

Technical Support
Staff member
The YX5300 datasheet shows that SPI Flash can be connected to it but the datasheets I have are all in Chinese so impossible for me to tell exactly how it works, what size chip is needed or how one would get an MP3 track into it. The chips might end up being just as expensive as micro-SD cards. And that's before trying to figure out how to mash two surface mount chips together.

The Tsunami Super WAV Trigger is a module which can handle up to 32 mono tracks simultaneously which seems perfect for what you want to do. That's $80 though.

First thing is to work out exactly how many sounds you need at the same time. You will probably need fewer players than sounds.
 

AllyCat

Senior Member
Hi,

The [memory] chips might end up being just as expensive as micro-SD cards.
+1. It may depend on how many files and what file size are needed for each player, but small SD cards seem to be available quite cheaply. I thought it might be necessary to "hack in" a standard-sized SD card, but small micro-SDs seem readily available, perhaps because they're the same as (or compatible with) "Transflash" cards.

Memory cards are one thing I normally don't recommend buying from ebay, because of the risk of "fakes" (e.g. cards having a smaller capacity than claimed). But that's less likely to happen with small capacity cards (and might not matter for just a few low quality sound files anyway). If you set a maximum price of (say) £2 in an ebay search, you have to filter out the enormous numbers of "adapters", "cases" and "readers", etc., but I did find a 1GB micro-SD, UK-sourced for just under £2, with the lowest prices around £1.29 for a 64M from China, etc..

Cheers, Alan.
 

premelec

Senior Member
If your search Ebay for "TF card U disk MP3 Format decoder board amplifier decoding audio Player module D" you'll find units that play microSD or USB stick for less than $2. i have one and it plays either SD or USB stick - and NO I haven't tried putting in both memory unit types at once to see what happens... ;-0
 

tmfkam

Senior Member
I'd suggest trying an SPE035 (DfPlayer) and checking the 'advert' option. I thought that suggested that files in an advert folder would play at the same time as other 'music' files. As the data sheet for the DfPlayer is rather confusing, some experimentation may be required.
 

Steve2381

Senior Member
Thanks all.

Its looking like around 5 or 6 sounds at the same time max.

I was going to get one of those SPE035 modules, but it said out of stock last night.
The datasheet says the main MP3 track halts while the advert plays

Tsunami Super WAV Trigger... never heard of that. I will research.

Those little MP3 8-pin DIL modules you mention Bill.b. I have one here, but never tried it. I had heard (and perhaps wrongly) that they were not very reliable or good quality.
Do you know of any code snippets for these so that I can quickly breadboard one and see what its like?

I will look harder for MicroSD cards. I could only find 1gb for about £5. Which made each MP3 module around £8/9 (If you bought the module from the UK).

I was also wondering about reliability. These modules will be constantly reading off the cards and I have had quite a few SD cards fail on me lately.

Thanks for all the help
 

Bill.b

Senior Member
Hi Steve

I used the code snippets from picaxe for the SPE035 to test the Chinese module.

I could not tell the difference between the SPE035 I am using on my bot and the Chinese module.

video of Chinese unit working in SPE035 socket.

https://www.youtube.com/watch?v=BNP2ViHBlGo

Bill
 
Last edited:

tmfkam

Senior Member
VLSI (Finland) make a module that can play royalty free music files (WAV, OGG) from a module that can be either controlled by a serial or parallel interface. The music files can be stored within the module and/or from microSD. The internal memory and firmware can be updated by inserting a microSD which can then be removed. The firmware can be customised at will, with source code provided, along with a compiler to compile and build the source code, firmware updater and so on. Perhaps the firmware could be modified to suit your needs? I initially was planning on using this in a project for work, we had the need for an external SD card slot, as this meant building my own module I started on redrawing the schematic and PCB before finding the DfPlayer SPE035 which covered our needs by supporting USB drives.

Thinking low tech... Would it be possible to have the background soundtrack on the left audio channel with the feature soundtrack on the right and simply mute one or the other as required? Or two SPE035 modules with either one speaker per module or the auxiliary outputs mixed into one separate amp?
 

Steve2381

Senior Member
The sounds are going to be mono, but each module is a certain effect, so they need to operate individually from their own speaker, or in a master mix (dependant on the sound).

The Sparkfun wav module seem the best option. $49 (Thanks Hippy - found via the Tsunami Super WAV Trigger route).

https://www.sparkfun.com/products/13660

That can play multiple files at once. Still a lump of cash, but its does the trick I suppose.

As for the little MP3 modules that are used in the SPE035... I found one in my workshop, but its got WTV020-M01 written on it (instead of WTV020-SD-20S or WTV020-SD-16P).
Anyone know what the difference is? Can't find a datasheet for it (will look on Ebay later)
 

Steve2381

Senior Member
In the PDF for the SPE035 Mp3 module, it has demo code

Code:
Symbol TX  = B.4
Symbol RX  = C.3
Symbol BUSY_PIN  = pinC.2
Symbol BAUD_FREQ = M8
Symbol BAUD = T9600_8
Symbol cmd   = b0
Symbol arg    = w1 ; b3:b2
Symbol arg.lsb = b2
Symbol arg.msb  = b3

High TX ; set TX pin high for idle high serial
Pause 2000

SerTxd ("Starting", CR, LF)
SerTxd ( "Select microSD Card", CR, LF)

cmd =$09 : arg =$0002 :  Gosub Send
Pause 4000

SerTxd ("Play MP3 folder song 0001.mp3", CR, LF)

cmd =$12 : arg =0001 : Gosub Send

Pause 1000
Stop

Send:
SetFreq BAUD_FREQ
Pause 10
SerOut TX, BAUD, ( $7E, $FF, $06, cmd, $00, arg.msb, arg.lsb, $EF)
SetFreq MDEFAULT
Return
It fails to compile because MDEFAULT isn't declared (second from last line). What should this be?
 

Bill.b

Senior Member
Remove the two setfreq commands in the Send routine and setfreq to M8 at the beginning of the program will work Ok.

Bill
 

Steve2381

Senior Member
Its my workshop laptop... out of wifi range, so probably an old editor version.
I seem to remember having loads of issues when I updated it, and ended up rolling back to the previous working editor.
Thanks Hippy
 

Steve2381

Senior Member
Well the WTV020M01 (Which is a WTV020-SD) is dead as far as I can see.
Powered it with 3.3v and the busy led is always on, which I do not believe is correct.
Tried 4x different MicroSD cards, no luck.

So... ordered a new one off Ebay. Only a few quid, so see where that goes.
Have not managed to track down any code to control these WTV020 modules by serial yet. Any pointers welcome!

Now to pick the brains of the clever folk (rather than start another thread - its the same project).

This project is getting involved and I now need to dim 3x 230v, 50W led lamps individually. I have had a look around for a micro controlled dimmer module that isn't silly money and cannot seem to find one.
There are a few old Velleman ones kicking around, but not cheap.

My initial thought (rightly or wrongly) was to simply use a mini servo directly turning a standard wall switch 250w dimmer module. This really will ensure total isolation of the 230v and Picaxe. I could 3d print a nice enclosure etc.
But... does seem a bit bodgy.

Decent selection of dimmers here..
https://www.esr.co.uk/products/frame_dimmers.htm

Any ideas?
 

tmfkam

Senior Member
That Sparkfun module does look good but as Steve2381 mentions, it is a little expensive. For that money you could buy a few DfPlayer / SPE035 modules and achieve much the same.

Given the DfPlayer / SPE035 is well understood on the forum, I'm surprised you didn't order one or two to replace the 'faulty' module.

The datasheet for the SPE035 sound module kit does mention that alternative modules are wired differently to the DfPlayer / SPE035 modules. I hate to suggest that you try the 'alternative' wiring diagram?

Dimming mains lighting is getting into dangerous areas, I'd start with something like this: Isolated light dimmer, ebay

Or, from the link you posted, something like the Velleman DC Controlled Dimmer Kit.
 

Steve2381

Senior Member
Mains dimmers are OK... I am a sparky, so I know the risks!

I have ordered a selection of MP3 modules and a couple of amps off Ebay.... see what I can get out of those
 

Ghostbear

Member
If your search Ebay for "TF card U disk MP3 Format decoder board amplifier decoding audio Player module D" you'll find units that play microSD or USB stick for less than $2. i have one and it plays either SD or USB stick - and NO I haven't tried putting in both memory unit types at once to see what happens... ;-0
Ooh.... these and the other TF cards look perfect for a project I'm planning. How easy are they to wirein and do they come with a Data Sheet?
 

tmfkam

Senior Member
I have tried using both microSD and USB at the same time.

If both are present at startup, the unit appears to select, by preference, the microSD.

It is possible to switch from one to the other using the select disk command, however I found this only about 95% reliable. For one reason or another, despite a USB device (with relevant files/folders) being present, I'd find that files from microSD were played even after selecting the USB disk every now and then. This may have been a timing issue with the commands, the unit can't respond to commands during the initial startup phase and unless you are monitoring the commands echoed back from the module this is not easy to judge reliably.

If only a USB device is present, all the units I had (a selection of both original PicAxe SPE035 and DfPlayer from China) will seamlessly load this at startup without any need for selecting the USB disk.

I have found these modules to be superb, the SPE035 kit with the PCB is ideal for getting to know the units.
 

tmfkam

Senior Member
Mains dimmers are OK... I am a sparky, so I know the risks!
I'd build my own in that case. There are any number of designs available. I'd use something like an 08M2 as a slave device to drive each 'dimmer' via some optocouplers, one for drive to the triac, one for zerocrossing detection and maybe a third for interfacing between the 08M2 slave and the main processor for additional isolation.

A commercial dimmer might be 'hackable' by replacing the pot with an LDR and LED driven by a PWM signal from a PicAxe, with a suitable housing to put the LDR/LED combination in that could provide the required isolation?

For anyone who isn't a Sparky, and doesn't know the risks: Mains voltages are LETHAL. Electrocution is a very real danger. A tiny mistake with mains electricity might lead to your death.
 

Steve2381

Senior Member
Well I have another WTV020 module and that doesn't work either. Tried it on a better PSU (I read that 3.3v was borderline enough), but the busy led comes on and just stays on.
I am suspecting the MicroSD card. So, ordered a 1gb Sandisk one (which was nearly as much as the module).

Amplifiers.... anyone got any good recommendations? I was hoping to find decent 12v module/kit but no luck yet. I have a Velleman 7w amplifier here, but its not particularly loud.
When put through some 4" car speakers, the sound is pretty awful.
The sound needs to be pretty loud (I am thinking 15-20w) ideally. Open to suggestions
 

Steve2381

Senior Member
Well don't want to dig up a thread from page 2, but just thought I would throw this out.
I have been playing with this MADLY sensitive and picky WTV020 module and still have not got it actually working. Its the sound format that is the issue.

I have 6 sd cards here, of which 2 appear to work when you load the sample AD4 files onto.

But, if I convert my own files to AD4, then nothing. Used the AD4 converter that is available for this module but no luck.

So, tried wav format... well I get sound, its just not anything useable.
Saving the files a low volume, pcm 32000Hz, 16 bit, sampled at 32000Hz, bit depth 16 in mono. I think they are the required specs.

But, then just come out as static. I am wondering if the conversion of the sample rate in Wavpad (editing software) is messing it up?

Certainly not using these for my project, as they are far too picnicky, but it would be nice not to be defeated
 

hippy

Technical Support
Staff member
There's a lot of conflicting information on the WTV020; some say it won't play .WAV files, some say it only works with 2GB cards, some say the maximum sample rate should be 28kbps.

If you can find something which can load or play AD4 files on your PC which play on the module you may be able to use that to display how/what the files are and compare those with the ones you are generating to see if you can spot any differences.

ADPCM file structure should be fairly well defined so you might be able to knock up your own PC code to at least read and display the header information of the files.
 

Steve2381

Senior Member
I have not found an AD4 player yet that I fear isn't full of spam/virus.

I read it didn't play .wav files.... yet it appears that may be wrong. Also, the 1gb card I have is one of the only two cards that seem to work.
When I say work... I mean spurt out static crap, but I know that its playing, as the busy led operates as it should (doesn't on the other MicroSD cards.

I think it will be random luck and hours of trial and error (although hours have already gone into it)
 
Top