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

Go Back   DevMaster.net Forums > Site Discussions > Articles Discussion
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-15-2003, 12:03 AM   #1
DmEditor
DevMaster Editor
 
Join Date: Jan 2005
Posts: 54
Default

OpenAL Lesson 2: Looping and Fade-away
Author:: Jesse Maurais
Description: Movement of an emiting source

Post your discussions/comments here by clicking on Add Reply.
DmEditor is offline   Reply With Quote
Old 10-02-2003, 04:36 PM   #2
LongMath
New Member
 
Join Date: Oct 2003
Posts: 1
Default

Fadeaway suggestion:

I'm new to OpenAL, but I came across a guide which has all the parameters you can use with alSourcei and found one that would be great for fadeaway. Here's a sample function:
Code:
alSourcePlay(source[0]); _sleep(5000); for (ALfloat n = 1.0; n > 0.0; n-=.01) { alSourcef(source[0],AL_GAIN,n); _sleep(10); } alSourceStop(source[0]);
If you run this snipet of code, the music will play for 5 seconds and then fade out over 1 full second. Change the _sleep command or the step value for n to alter the time it takes for the sound to fade.

Thanks for giving me somewhere to start and I hope you found this suggestion useful!
LongMath 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 12:02 PM.


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