Skyline Lua API  Version 1.0 RC1
Lua Script Reference for Skyline Game Engine.
LUA_API_Sound.h
Go to the documentation of this file.
1 // | _ ____ __ _
2 // | / \ _ _ _ __ __ _/ ___| ___ / _| |_
3 // | / _ \| | | | '__/ _` \___ \ / _ \| |_| __|
4 // | / ___ \ |_| | | | (_| |___) | (_) | _| |_
5 // | /_/ \_\__,_|_| \__,_|____/ \___/|_| \__|
6 // |
7 // | Aurasoft UK 2008 - 2016 http://www.aurasoft.co.uk
8 // |
9 // | Skyline Game Engine Lua API Documentation
10 // |
11 // | This file belongs to Aurasoft UK for the Skyline Game Engine of all versions.
12 // | This file is not for use in any other software that is not owned by Aurasoft UK and cannot be used by any other
13 // | person outside of the Skyline Game Engine development team.
14 // |
15 // | © Copyright - Aurasoft UK & Skyline Game Engine 2008 - 2016
16 // |
17 
18 // SKYLINE LUA CLASS FOR API DOCUMENTATION
19 
40 class sound
41 {
42 public:
43 
57  void setLooped( int enableState );
58 
59 
73  void setVolume( float volume );
74 
88  void setPitch( float pitch );
89 
90 
104  void setSoundFile( string soundFilename );
105 
119  void setIsStreamed(int enableState);
120 
134  int createSound();
135 
149  void play2DSound( int soundID );
150 
172  void play3DSound( int soundID, float posX, float posY, float posZ );
173 
190  void stopSound( int soundID );
191 
209  int isPlaying( int soundID );
210 
228  void changePosition( int soundID, float posX, float posY, float posZ );
229 
244  void changeVolume( int soundID, float volume);
245 
260  void changePitch( int soundID, float pitch);
261 
274  void setRolloff(int soundID, float rolloff);
275 
288  void setMaxDistance(int soundID, float distance);
289 
290 
303  void setMinDistance(int soundID, float distance);
304 
323  void freeSound( int soundID);
324 
335  sound.distanceAttenuation( int soundID, float minDistance, float maxDistance, float minimum, float maximum);
336 
337 };
void setPitch(float pitch)
Set the Pitch of the new sound to create. This Function is used when creating a new sound...
void setVolume(float volume)
Set the Volume of the new sound to create. This Function is used when creating a new sound...
void changePitch(int soundID, float pitch)
Change the Pitch of a sound without stopping and restarting the effect. It also works on sounds that ...
void changeVolume(int soundID, float volume)
Change the Volume of a sound without stopping and playing the effect. It also works on sounds that lo...
int isPlaying(int soundID)
Check whether a sound is being played. Looped sounds are automatically stopped, so their playing flag...
void setRolloff(int soundID, float rolloff)
Sets the sounds attenuation fall off amount ie how quicly the sound fades out.
void play3DSound(int soundID, float posX, float posY, float posZ)
Play the Specified sound in 3D space by passing this function a Sound ID. This will play the sound at...
void setMaxDistance(int soundID, float distance)
Sets the sounds max attenuation distance. At this distance the sound will be at its lowest volume or ...
void changePosition(int soundID, float posX, float posY, float posZ)
Change the location in world space of a 3D sound that is playing. The 3D sound can be accessed by pas...
sound distanceAttenuation(int soundID, float minDistance, float maxDistance, float minimum, float maximum)
add to an update() to give an spawned sound distance attenuation.
void freeSound(int soundID)
Frees the sound for reuse. It also works on sounds that loop and sounds that are lengthy.
void setIsStreamed(int enableState)
Set whether the Soundfile is streamed from the hard drive. This Function is used when creating a new ...
void setLooped(int enableState)
Set the looped state of the sound. This Function is used when creating a new sound. You need to set this function before calling createSound() or create3DSound().
Definition: LUA_API_Sound.h:40
void setSoundFile(string soundFilename)
Set the Soundfile to use. This Function is used when creating a new sound. You need to set this func...
void setMinDistance(int soundID, float distance)
Sets the sounds min attenuation distance. This is where the sound will be at its loudest before atten...
int createSound()
Create a new 2D Sound using the Properties you set by calling the previous functions. This will return a sound ID that you can use to identify the sound.
void play2DSound(int soundID)
Play the Specified sound by passing this function a Sound ID.
void stopSound(int soundID)
Stop a sound that is currently playing.