Playing two samples at once!

Im trying to create a little audio board that will be able to play two samples at the same time!

I want to use ONE sd card / eeprom with ONE arduino and TWO mp3 decoders

im thinking of using this dataflash to store the samples (AT45DB161D), the samples will be very low bit rate and small in size so 2meg should be enough

is the arduino fast enough to stream data from this dataflash and send it to two mp3 decoders?

any better ideas on how to play multiple samples? (they can be wav/mp3 or wot ever really :))

i dont want to simply just buy to ready built embedded mp3 player modules i want to build this thing my self :)


Probably not, if you can only read one piece of a sample in each acess to the Flash how will you play TWO different samples at once?
But if the mp3 chips are the VS family they probably have more processing power than one arduino…

My plan was

When i down load the samples into the flash they would all be joined together and ill have a little array with the starting index location for each sample.

The mp3 chips work by requesting upto 32 bytes then when there buffer is full they stop requesting, giving you time to do other things. (my low bit rate will give me alot of spare time! as i wont have to stream the mp3 data that quick)

So i think i would get away with (im using very low bit rate like 22kb) jumping around the flash while the mp3 decoder is full to get data for the other mp3 decoder.

i think it could work! :)

i could probably do the same idea using the sd card and just having 1 mp3 with all the samples in it, but im pretty sure the flash will be alot quicker then sd card?

i think it could work!

Well as with a single sample sound card from Ada the maximum bit rate is about 24K samples per second for a wav file, I recon that you can probably only go at 11K bytes / second on your MP3. However as the MP£ is compressed you need to fetch a lot fewer samples so you might just be able to get away with a decent decoded sample rate.

I remember seeing a MP3 chip at that could handle 2 MP3 streams at once. Maybe that would help you out?

ah yes could you track that chip down again would save me using two decoders

thanks :)

Here, but sadly not MP3 support, but 3 streams at the same time! :grin:


This looks like a nice chip, I'm curious too now. ;-)

wav is cool lol

And it gets better, it takes compressed WAV, not as good as MP3, but it is great.

doesn't look like any one has written a arduino library for it.

this could be interesting

aless i have read the datasheet wrong the VS1103b can only mix the line in, midi and wav streams u cant just give it 2 wav streams

so it does mix input streams but just 1 of each type :(

could some one confirm this as im quite new to electronics :)

looks like i might be back to using 2 simpler VS1xxx mp3 decoders hehe

Actually, its Wave Stream[u]s[/u] so its multiple streams. ;-)

VS1103b is a single-chipMIDI/ADPCM/WAV audio decoder and ADPCM encoder that can handle upto three simultaneous audio streams.

So yes, it allows you to send 3 audio-data, plus, it mixes the other analog signal along.

iv had a quick read of the datasheet and cant see how you send it 3 audio streams, how does it know which stream is which? it only has 1 spi data bus like all the other vs1xxx mp3 decoder chips and seams to work pretty much identical to them. cant see how you send it three streams how does it know which is which?

any help would be much appreciated it

When you send i.e. PCM you specify the number of channels you want to send in the header (page 42 in the VS1103 datasheet) and set length to -1. Then you feed the data to be converted to Audio. Be aware of all the different formats (2's compliment i.e.) and the byte order.

ahh, for my board it might be playing one sample by its self then another one might start so its at that point they will need to be glued together. then the first one might finish so it will just be left with the original one.

maybe using 2 normal vs mp3 decoders would be alot simpler + i would be able to use mp3