EmbDev.net

Forum: µC & Digital Electronics Playing two or more WAV files simulatneously


Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
Hello,

I want to design a microprocessor board which will be capable of playing 
up-to 16 audio streams simultaneously. The audio streams will be stored 
in flash or SD card as WAV files.

Does someone knows if how I can do it?

Thanks,
Ersin

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
Ok, sounds easy. As long as you decide to play back 8 bit sounds with 8 
khz sampling frequency. :)

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
sd card lib:

elm-chan.org/docs/mmc/mmc_e.html

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
Your problem will be the data transfer rate of the sd-card. With the 
libs from elm chan you will get maybe 300 kb /sec. As long as you read 
only one file, and have big buffers (sector size) on the mc. So reading 
16 files simultaneously from one sd-card doesn't work! Believe me.

What to do?
-multiple sd-card / flash drives
-avoid overhead / fragmentation from fat -> create your one stream file 
system.

A little calculation what the transfer rate should reach:

16 bit, 32 mono channels (16 stereo channels) * 44100 khz
bit depth  channels  sampling frequency
=22.579.200 = ca. 22 Mb / sec :)

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
Thanks for the answers.

It will be 48 Khz, 16 bits. Audio stream has no compression.

SD or flash storage is not a problem. I have difficulties in audio 
electronic part.

Thanks
Ersin

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
What difficulties? Audio output (audio dac circuit), mixing, controlling 
all that stuff?

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
My problem is mainly mixing two or more audio streams.

I will have one microprocessor and an FPGA available on the board.

I will mix the audio streams either digitally in the FPGA or by using 
multi ADCs and an analog circuit to mix them. In either way I don't know 
exactly how to do it.

Author: Markus (Guest)
Posted on:

Rate this post
0 useful
not useful
Are you Ersin Oezalp from BARAN Microelectronic GmbH?

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
Yes, do we know each other

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
With an fpga, that is another challenge: You need to setup a microblaze 
core or something to controll all that stuff. Then access the sd-card / 
flash drives from that core. Big tasks!


Digital mixing algo. for unsigned 16 bit values:

A + B – A·B / 65536

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
Sorry Z = A + B – A·B / 65536

A = sample 1
B = sample 2
Z = mixed sample

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
Seems complicated for an FPGA but can be done. Do you know how I can to 
it with 16 DACs (I have to mix 16 streams).

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
16 dacs, forget about it - or find somebody who route this beast for 
you... Mixing analog signals is very easy. Just use an op, insert an 
adjustable resistor in the feedback loop to control sum gain. Each 
channel needs an poti to to controll the channel volume like here:

http://yusynth.net/Modular/EN/MIXER/Mixer-1U.html

It is build on a breadboard in minutes...


greetz jonas

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
With the dacs, do you plan using some of the "new" DACs more or less 
with an codec used and clock frequence = fs * 256 or some of the old 16 
bitters....?

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
Jonas, thank you very much for the analog circuit. It helped me a lot.

I think I have to use 16 DACs since I have 16 digital audio streams. Is 
this correct? But I didn't decide yet which DAC to use.

Author: jonas biensack (Guest)
Posted on:

Rate this post
0 useful
not useful
No thanks! I like to help. :)

>I think I have to use 16 DACs since I have 16 digital audio streams. Is
>this correct? But I didn't decide yet which DAC to use.

This is correct. As long as you don't use a dac with multiple channels.
But let us go ahead (we assume to use an easy to handle one like this 
Rohm BU9480F, here the link: 
http://elm-chan.org/works/pcmp/report.html):

You need to avoid (oh it is really challenging me to explain this in 
english)
bad ground loops in your circuit, and that is not all...
I think you need to read a few hints to designing a good dac layout with 
16 dacs. Maybe you are lucky and some of the masters reign this forum 
can give you some more information. I stay on...

Author: Ersin Oezalp (Company: BARAN) (baran-tech)
Posted on:

Rate this post
0 useful
not useful
What about this chip from TI:
http://focus.ti.com/docs/prod/folders/print/pcm1602a.html
It has 6 DACs. I have to use 3 parallel to achive 16 channels.

Actually I am an experienced PCB and hardware designer. The problem is 
that this is my first audio project. I developed mostly industrial 
control electronics.

I will investigate more on filtering and routing audio signals.

Thanks a lot.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.