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 02-13-2006, 09:41 PM   #1
Zeussy
New Member
 
Join Date: Feb 2006
Posts: 3
Default OpenAL can't replay sounds

So, I've been busy, modifiy the tutorials around to make a OpenAL wrapper class.

I've been writing a renderer in Directx and linking objects to sources so I can update there position and stuff, but that isnt so much the problem.

I can't replay a sound once its been played, here is my little function:

Code:
void zSoundEngine::PlaySound( int Source ) { //Check if sound is playing int play; alGetSourcei(g_Sources[Source], AL_SOURCE_STATE, &play); if (play != AL_PLAYING) { // Play alSourcePlay(g_Sources[Source]); if ((error = alGetError()) != AL_NO_ERROR) DisplayALError("alSourcePlay : ", error); } }

Now, it plays the sound once, then never again. But if I step through, it will repeat the sound. But only if I step through alSourcePlay.

Another thing I have noticed, i downloaded the Multiple sources Tut, and just ran the ExE, none of the sources replay in that, appart from the looping battlefield sound.

So I'm completely stumped, almost seems like a dodgy dll to me, but idk.

Any help will be appreciated.
Zeussy is offline   Reply With Quote
Old 07-26-2006, 07:36 AM   #2
lazarus
New Member
 
Join Date: Apr 2006
Location: Austria
Posts: 1
Default Re: OpenAL can't replay sounds

Call alSourceRewind(g_Sources[Source]) before alSourcePlay(...)
lazarus is offline   Reply With Quote
Old 07-26-2006, 08:53 AM   #3
monjardin
Senior Member
 
Join Date: Oct 2005
Location: Pensacola, FL
Posts: 1,028
Default Re: OpenAL can't replay sounds

Lazarus: What an appropriate name for a forum necromancer!
___________________________________________
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*
monjardin 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 04:57 AM.


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