DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Programming & Development > Sound and Music Programming
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 05-07-2004, 09:19 AM   #1
rogerdv
Member
 
rogerdv's Avatar
 
Join Date: Jul 2003
Posts: 97
Default

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
rogerdv is offline   Reply With Quote
Old 07-10-2004, 06:58 AM   #2
mario++
New Member
 
Join Date: Jun 2004
Posts: 4
Default

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
mario++ is offline   Reply With Quote
Old 07-10-2004, 07:26 AM   #3
rogerdv
Member
 
rogerdv's Avatar
 
Join Date: Jul 2003
Posts: 97
Default

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
rogerdv is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 01:58 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.