Welcome! Log In Create A New Profile

Advanced

Play multiple sounds at the same time

Posted by diego_pmc 
Play multiple sounds at the same time
May 15, 2010 09:03PM
I would like to know what to do in order to be able to play multiple sounds at once. I'm using the library/wrapper found in "mp3player.h" and it seems that it can only play one sound at once (the same with some MOD libraries I've seen).
Re: Play multiple sounds at the same time
May 16, 2010 12:29AM
Look at the second parameter of ASND_SetVoice. If you have different voice number then you could play multiple sound at the same time. By default the MOD player uses 0.
Re: Play multiple sounds at the same time
May 16, 2010 04:37AM
and if you don't want to remember the number of voices currently going check out using ASND_GetFirstUnusedVoice()

makes it real easy!

ASND_SetVoice(SND_GetFirstUnusedVoice(), 0, 44100, 0, soundfx, soundfx_size, 255, 255, NULL);
Re: Play multiple sounds at the same time
May 16, 2010 07:05PM
Thanks, that should solve it.
Re: Play multiple sounds at the same time
June 03, 2010 02:21PM
Hi,

I have a complementary question for this topic...
The function ASND_SetVoice read only PCM Files. Is there a solution to play multiple MP3 files with mp3player.h (or the MOD reader) ?

I've examine the header, and no function allow the user to set a new Voice for the MP3 reader (nor MOD reader). Is there a trick to force MP3Player_PlayBuffer to use a defined voice ?
Sorry, only registered users may post in this forum.

Click here to login