Main Site Documentation

Play Music on Fez PANDA II


#1

Hi

I know the FEZ Audio Out project on the wiki.

It shows how to play a single file using the analog out of the panda.

My question is:

If I want to play a complete file, first I need to have a 8bits PCM Wav file in order to be able to play, gotcha, but, what if I want to play a 2 Mb file ?

I know that I won’t be able to load a “so huge” file on the panda, so, if I want to play it, I surely need to get the chunk and give them to the Analog out.

My problem is about “timing” to call the set method of the analog output.

How can I know when the “chunk” has been played and then provide the next chunk ?

What do you think of that ?

I’m intending to create a “SoundPlayer” class to achieve this. What should I take into account to do it ?
Are there any points that can’t be solved ?

Thanks


#2

You need this http://www.ghielectronics.com/catalog/product/289


#3

but honestly, starting from the FEZ Audio Out sample, don’t you think it could be possible to play a music file (8bits PCM) with the panda without the Music Shield ?

It took a look at the “driver” provided for the music shield, and when I read this line:

byte[] data = Resources.GetBytes(Resources.BinaryResources.song);
musicShield.Play(data);

I have the feeling that if the file is more than xx kb, it will failed because of the memory limitation of the panda II… Is my analysis wrong ?


#4

You will pay megabytes but in chunks. File will be on SD card (or network) then you will read the data piece by piece and then playback.

Even your PC with 4GB of RAM will play files piece by piece.


#5

I know this…

So in a way, you confirm that playing long file means “deal with chunk”, whatever I will use (shield or no shield)…

concerning my question:

byte[] data = Resources.GetBytes(Resources.BinaryResources.song);
musicShield.Play(data);

You confirm that if the file size is too big, it will lead to “exception” ?


#6

Yes corect