StartTrackedSound

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '{{AudioMethod | audio.startTrackedSound(soundFilename [, gain [, modulation [, x, y, z, [speedX, speedY, speedZ]]]]) | Plays an audio file with a position in space, but also retu...')
 
Line 3: Line 3:
audio.startTrackedSound(soundFilename [, gain [, modulation [, x, y, z, [speedX, speedY, speedZ]]]])
audio.startTrackedSound(soundFilename [, gain [, modulation [, x, y, z, [speedX, speedY, speedZ]]]])
|
|
-
Plays an audio file with a position in space, but also returns an id for updating purposes. The volume and panning is then calculated based on the [[setSoundListenerPosition]].
+
Plays an audio file with a position in space, but also returns an id for updating purposes. The volume and panning is then calculated based on the [[setSoundListenerPosition]]. '''The sound will loop until it is stopped.'''
|
|
{{MethodParam|soundFilename|A string|The name of the audio file, relative to the source folder. The name is case sensitive on Mac OS X.}}
{{MethodParam|soundFilename|A string|The name of the audio file, relative to the source folder. The name is case sensitive on Mac OS X.}}

Latest revision as of 13:55, 18 January 2010

audio.startTrackedSound(soundFilename [, gain [, modulation [, x, y, z, [speedX, speedY, speedZ]]]])

Plays an audio file with a position in space, but also returns an id for updating purposes. The volume and panning is then calculated based on the setSoundListenerPosition. The sound will loop until it is stopped.

Parameter Expected Type Description
soundFilename A string The name of the audio file, relative to the source folder. The name is case sensitive on Mac OS X.
gain A number The power at which the sound is emitted.
modulation A number How pitch shifted the sound should be. Original pitch is 1.
x A number Position in space, in meters.
y A number Position in space, in meters.
z A number Position in space, in meters.
speedX A number The speed of the sound in space, for creation of doppler effects, in meters/second.
speedY A number The speed of the sound in space, for creation of doppler effects, in meters/second.
speedZ A number The speed of the sound in space, for creation of doppler effects, in meters/second.
Returns

Returns one value, soundId, or nil in case the soundFilename doesn't exist.

Daisymoon Audio Lib

Example

   local mySound = audio.startTrackedSound("fireball.wav")
   local fireBall = { x = 100 , y = 0 }
   audio.updateTrackedSound(mySound, 1 ,1 , fireBall.x, fireBall.y, 0)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox