![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
Member
Join Date: Jul 2003
Posts: 97
|
I tried to adapt the example in the ogg streaming article to my game. But in my project, I cant use the loop while(stream.update), I have to call update from my main game loop. But it doesnt works, simply plays a second of music and the buffrs is not updated anymore. Can somebody give me an idea?
___________________________________________
News and resources for game programming newbies |
|
|
|
|
|
#2 |
|
New Member
Join Date: Jun 2004
Posts: 4
|
i can help you, put the update into a principal loop
the code for the funtion is int processed; bool active = true; alGetSourcei(m_OggSource, AL_BUFFERS_PROCESSED, &processed); while(processed--) { ALuint buffer; cout << "procced: "<< processed << endl; alSourceUnqueueBuffers(m_OggSource, 1, &buffer); if(alGetError() != AL_NO_ERROR) { return false; } active = OxOggStream(buffer); alSourceQueueBuffers(m_OggSource, 1, &buffer); if(alGetError() != AL_NO_ERROR) { return false; } cout << "active: "<< active << endl; } return active; if you have a problem with the sound try to change the buffer value |
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2003
Posts: 97
|
Here is the code:
alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed); cout << "Processed "<<processed<<endl; while(processed--) { ALuint buffer; cout << "proced: "<<processed << endl; alSourceUnqueueBuffers(source, 1, &buffer); if (alGetError!=AL_NO_ERROR) { return false;} //check(); active = stream(buffer); alSourceQueueBuffers(source, 1, &buffer); if (alGetError!=AL_NO_ERROR) { return false;} //check(); cout <<"Active "<<active <<endl; } I just hear half second of music. Here is the output Processed 2 proced: 1 Processed 1 proced: 0 Processed 0 Processed 0 Processed 0 Processed 0 As you can see, after the first call, all next returns 0 in processed, so, the app never enters the loop.
___________________________________________
News and resources for game programming newbies |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|