Jump to content

Ambient Source bug on iOS


photo

Recommended Posts

Hi,

I have two différent ambient source in my world and i want switch the sound.

 

I try three method,

 

1-two object and when i switch stop one and play thé second

 

2-two object playing and just change the gain 0 or 1

 

3-one object and when i switch délecte thé last and create new

 

For each method sometimes the second sound loop just the first seconds and bug if i switch again with the first ambient source thé first play well.

 

For info i work on iPad 2 with iOS 5

Link to comment

Sorry, but the bug is a big problem, come sometimes on iOS 4 or 5 and one time on windows.

 

It's an very handicap for release the app.

 

I'm alone with thé bug ???

Link to comment

Hi, can you please specify what is the exact problem. What did you mean by: "For each method sometimes the second sound loop just the first seconds and bug if i switch again with the first ambient source thé first play well."

Whether it means that the second source stops playing after few seconds, or whether it bugs after switching? Please clarify.

And we need the code you use to switch sources.

Link to comment

Sorry for my english is very bad.

 

The second sound play the first frame but looping on the first frame. The sound don't stop. That give a "rap" style ....

 

I try to make some project for the bug. But it doesn't come everytime. BTW, on iOS5 i have a lot of OpenAl error.

Link to comment

Yes, we are aware of the OpenAL errors for iOS.

So, as I understand, when you switch to the second source it starts to loop, giving you a nice old rap style? And when you switch back to the first one, does the second stop?

May be you can supply the code on which you had the error?

Link to comment

// buffers processes

 

ALint buffers_processed = 0;

alGetSourcei(source_id,AL_BUFFERS_PROCESSED,&buffers_processed);

 

printf("Buffer Processed : %d\n",buffers_processed);

// queue buffers

 

if(buffers_processed == 1) {

...

printf("Buffer ID : %d\n",buffer_id);

...

 

}

 

When the bug coming the buffers_processed is blocked with the value 0, and it seems the openal error come here but i'm not sure.

I do a lot of tests :

 

1 -> put the music outside ing/zip file

2 -> sync the fps to 30 or 60

3 -> change bitrate the music

 

I make an sample test but i don't have the bug i switch 3 different stream music all 5 second and play stop the sound every 10 frame and i do an BIG loop for an very low fps, but nothing ...

The only difference with my code is the music is playing when the world is loading.

Link to comment

I found an solucion for don't have the bug.

 

It's not Nice but work, all my ambient source stream is global and init with loop and gain at 0.0001 (not 0 give problem) and play.

 

After that i don't call play or stop again, just change gain.

 

For me i can do with that but it's dirty

Link to comment
×
×
  • Create New...