Sound playback. More...
Public Member Functions | |
| integer | Play (integer sound, integer loopPoint, decimal panning=0.0, decimal speed=1.0, decimal volume=1.0) |
| Plays a sound either once or in a loop. | |
| void | Stop (integer sound) |
| Stops an actively playing sound. | |
| void | Pause (integer sound) |
| Pauses an actively playing sound. | |
| void | Resume (integer sound) |
| Unpauses a paused sound. | |
| void | StopAll () |
| Stops all actively playing sounds. | |
| void | PauseAll () |
| Pauses all actively playing sounds. | |
| void | ResumeAll () |
| Resumes all actively playing sounds. | |
| boolean | IsPlaying (integer sound) |
| Checks whether a sound is currently playing. | |
| integer | PlayMultiple (integer sound, integer loopPoint, decimal panning=0.0, decimal speed=1.0, decimal volume=1.0) |
| Plays a sound once or loops it, without interrupting channels playing the same sound. | |
| void | PlayAtChannel (integer channel, integer sound, integer loopPoint, decimal panning=0.0, decimal speed=1.0, decimal volume=1.0) |
| Plays or loops a sound at the specified channel. | |
| void | StopChannel (integer channel) |
| Stops a channel. | |
| void | PauseChannel (integer channel) |
| Pauses a channel. | |
| void | ResumeChannel (integer channel) |
| Unpauses a paused channel. | |
| void | AlterChannel (integer channel, decimal panning, decimal speed, decimal volume) |
| Alters the playback conditions of the specified channel. | |
| integer | GetFreeChannel () |
| Gets the first channel index that is not currently playing any sound. | |
| void | IsChannelFree (integer sound) |
| Checks whether a channel is currently playing any sound. | |
| integer | GetLoopPoint (integer sound) |
| Gets the loop point of a sound index, if it has one. | |
| void | SetLoopPoint (integer sound, integer loopPoint) |
| Sets the loop point of a sound index. | |
Sound playback.
| void Sound.AlterChannel | ( | integer | channel, |
| decimal | panning, | ||
| decimal | speed, | ||
| decimal | volume ) |
Alters the playback conditions of the specified channel.
| channel | The channel index to resume. |
| panning | Control the panning of the sound. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. |
| speed | Control the speed of the sound. Higher than 1.0 makes it faster, lesser than 1.0 is slower, 1.0 is normal speed. |
| volume | Controls the volume of the sound. 0.0 is muted, 1.0 is normal volume. |
| integer Sound.GetFreeChannel | ( | ) |
Gets the first channel index that is not currently playing any sound.
| integer Sound.GetLoopPoint | ( | integer | sound | ) |
Gets the loop point of a sound index, if it has one.
| sound | The sound index to get the loop point. |
| void Sound.IsChannelFree | ( | integer | sound | ) |
Checks whether a channel is currently playing any sound.
| sound | The channel index. |
| boolean Sound.IsPlaying | ( | integer | sound | ) |
Checks whether a sound is currently playing.
| sound | The sound index. |
| void Sound.Pause | ( | integer | sound | ) |
Pauses an actively playing sound.
| sound | The sound index to pause. |
| void Sound.PauseChannel | ( | integer | channel | ) |
Pauses a channel.
| channel | The channel index to pause. |
| integer Sound.Play | ( | integer | sound, |
| integer | loopPoint, | ||
| decimal | panning = 0.0, | ||
| decimal | speed = 1.0, | ||
| decimal | volume = 1.0 ) |
Plays a sound either once or in a loop.
| sound | The sound index to play. |
| loopPoint | Loop point in samples. Use AUDIO_LOOP_NONE to play the sound once or AUDIO_LOOP_DEFAULT to use the audio file's metadata. (default: AUDIO_LOOP_DEFAULT ) |
| panning | Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. |
| speed | Control the speed of the audio. Higher than 1.0 makes it faster, lesser than 1.0 is slower, 1.0 is normal speed. |
| volume | Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. |
| void Sound.PlayAtChannel | ( | integer | channel, |
| integer | sound, | ||
| integer | loopPoint, | ||
| decimal | panning = 0.0, | ||
| decimal | speed = 1.0, | ||
| decimal | volume = 1.0 ) |
Plays or loops a sound at the specified channel.
| channel | The channel index. |
| sound | The sound index to play. |
| loopPoint | Loop point in samples. Use AUDIO_LOOP_NONE to play the sound once or AUDIO_LOOP_DEFAULT to use the audio file's metadata. (default: AUDIO_LOOP_DEFAULT) |
| panning | Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. |
| speed | Control the speed of the audio. Higher than 1.0 makes it faster, lesser than 1.0 is slower, 1.0 is normal speed. |
| volume | Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. |
| integer Sound.PlayMultiple | ( | integer | sound, |
| integer | loopPoint, | ||
| decimal | panning = 0.0, | ||
| decimal | speed = 1.0, | ||
| decimal | volume = 1.0 ) |
Plays a sound once or loops it, without interrupting channels playing the same sound.
| sound | The sound index to play. |
| loopPoint | Loop point in samples. Use AUDIO_LOOP_NONE to play the sound once or AUDIO_LOOP_DEFAULT to use the audio file's metadata. (default: AUDIO_LOOP_DEFAULT) |
| panning | Control the panning of the audio. -1.0 makes it sound in left ear only, 1.0 makes it sound in right ear, and closer to 0.0 centers it. |
| speed | Control the speed of the audio. Higher than 1.0 makes it faster, lesser than 1.0 is slower, 1.0 is normal speed. |
| volume | Controls the volume of the audio. 0.0 is muted, 1.0 is normal volume. |
| void Sound.Resume | ( | integer | sound | ) |
Unpauses a paused sound.
| sound | The sound index to resume. |
| void Sound.ResumeChannel | ( | integer | channel | ) |
Unpauses a paused channel.
| channel | The channel index to resume. |
| void Sound.SetLoopPoint | ( | integer | sound, |
| integer | loopPoint ) |
Sets the loop point of a sound index.
| sound | The sound index to set the loop point. |
| loopPoint | The loop point in samples, or null to remove the audio's loop point. |
| void Sound.Stop | ( | integer | sound | ) |
Stops an actively playing sound.
| sound | The sound index to stop. |
| void Sound.StopChannel | ( | integer | channel | ) |
Stops a channel.
| channel | The channel index to stop. |