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..
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?
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.
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?
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