Playing 2 sound files simultaneously in OpenAL..

Started by tylee2135, April 08, 2004, 07:16:00

Previous topic - Next topic

tylee2135

Hi guys..
Ive just got started on doing OpenAL and my question is abt playing 2 sound files simultaneously.. ive been trying out the openAL source files.. Ive tried creating 2 instances of the PlayTest class.. passing in 2 diff string names.. but the sounds don play at the same time even though both instances were successfully created.. Please advise! Thanks!

spasi

I haven't used OpenAL, but from what I've heard from our sound developer, you have to create a source (alSource) for each playing sound.

Matzon

yes, 1 source per buffer playing at any one time.

tylee2135

Im enlightened!  :)  Thanks alot for the advice.. ill go work on it..
Anyway while doing openAL i got an error that says..

OpenAL error: Invalid Enum

What is it that im not doing properly?

tylee2135

Anyway.. ive solved the Invalid Enum error.. seems that the error was brought abt because i used the statement

AL.alSourcef(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
instead of
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);

ANd ive also managed to successfully play multiple sounds simultaneously.. But just one more question.. is it possible to run 2 different classes together.. i thought of doing one to manage background music and one to manage sound... Can i still play the music and sound simultaneously or do they all have to be in one class altogether?
Thanks alot for all of your help! :)