Pages: [1] 2   Go Down
Author Topic: Playing two samples at once!  (Read 6137 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley)

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

thanks
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley



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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34246
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

thanks smiley
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here, but sadly not MP3 support, but 3 streams at the same time!  smiley-mr-green

http://www.sparkfun.com/products/8894
Logged


Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also: http://www.sparkfun.com/products/8953

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


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

wav is cool lol
Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

this could be interesting
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad

http://www.vlsi.fi/fileadmin/datasheets/vlsi/vs1103.pdf

could some one confirm this as im quite new to electronics smiley



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

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually, its Wave Streams 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.
Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 142
jayduino rox
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Juergen

Pages: [1] 2   Go Up
Jump to: