Welcome! Log In Create A New Profile

Advanced

multiple mp3 same time?

Posted by dirfinyu 
multiple mp3 same time?
December 05, 2011 10:42PM
Hi!
Im learning about wii programing. I have found a big problem. I want to play 2 or 3 simultaneous mp3 but i cant. I write the code this:
#include
#include "ambiente1_mp3.h"
#include "hyrulefield_mp3.h"


void initsdsound(){
if (!fatInitDefault()) {
printf("Unable to initialise FAT subsystem, exiting");
exit(0);
}
ASND_Init(NULL);
MP3Player_Init();
ASND_Pause(0);

}

In Main i write:
MP3Player_PlayBuffer(hyrulefield_mp3,hyrulefield_mp3_size,NULL);

And if you press buton B y write:
MP3Player_PlayBuffer(ambiente1_mp3,ambiente1_mp3_size,NULL);


But it not works, you cant hear ambiente1. I have try to run a ogg, then hyrulefield.mp3 stops and ambiente1 runs. But never same time.
How can i solve this problem. Sorry my english!
Thanks!!
Re: multiple mp3 same time?
December 05, 2011 11:32PM
Hi dirfinyu!

Nice to see you here. Play more than one mp3 stream simultaneusly is not possible because MP3Player uses always (and only) sound channel 0.

OggPlayer is also using channel 0, due to it is not possible to play an ogg file and a MP3 file simultaneusly.

Oggplayer source is public. Perhaps you can modify Oggplayer to play more than one song in parallel.
Re: multiple mp3 same time?
December 06, 2011 02:33AM
xDD always helping me wilco!
Thanks for the solution, now works perfectly
Re: multiple mp3 same time?
December 06, 2011 04:22PM
if you have the time you could break the mp3s into small bits and use ASNDLIB functions to try and mix them together.
Re: multiple mp3 same time?
December 06, 2011 04:52PM
thanks owen!
The problem is i dont understand ASNDLIB well. For example i try to play this form
ASND_SetVoice(8, VOICE_MONO_16BIT, 44100,0, (void *)ambiente1_mp3, ambiente1_mp3_size, 100, 100, NULL);

But it not works, Thats the problem i dont know how use this function as well.
Re: multiple mp3 same time?
December 06, 2011 04:58PM
It only plays snd files encoded in certain format (which is really annoying). The instructions are on its page; [wiibrew.org] you will have to download goldwave to convert the files to the *.snd format.
Re: multiple mp3 same time?
December 06, 2011 05:35PM
You have to take in account you export to raw format with exactly the same sound frecuency and mode than you uses in your ASND_SetVoice function.
Re: multiple mp3 same time?
December 06, 2011 07:31PM
Thanks a lot owen and wilco. Now i can play more than 2 sounds same time. Thanks a lot. Wilco, a especial number of the tutorial with sounds jejeje
Re: multiple mp3 same time?
December 06, 2011 11:20PM
Chapter 8 will include mp3, ogg and raw sounds, and file access, but I think you know a lot of all theese matters.
The example program is a photo/music viewer. My question in the another topic in this forum ("jpg images crashes loading twice") have relation with chapter 8.
Re: multiple mp3 same time?
December 06, 2011 11:40PM
Yes, i`m learning more and more every day. Im making this project [www.elotrolado.net]
All thanks your tutorial, that motivated me.

Entre tu y yo, ojala que se anime la gente, joe que esta chupao hacer cosas.
Sorry, only registered users may post in this forum.

Click here to login