Audio
Look up audio calls and properties.
sound.playing
Read or change whether sound is playing.
- Arguments
No call arguments. Assign bool to change it.
- Returns
bool. Readable and writable.
- Works with
sound handles.
- Missing values and errors
Removed objects and unsupported handle kinds cannot supply this property.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
debug.log(speakers[0].sound.playing)
}sound.looped
Choose whether the sound loops.
- Arguments
No call arguments. Assign bool to change it.
- Returns
bool. Readable and writable.
- Works with
sound handles.
- Missing values and errors
Removed objects and unsupported handle kinds cannot supply this property.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
debug.log(speakers[0].sound.looped)
}sound.volume
Read or change sound volume.
- Arguments
No call arguments. Assign number to change it.
- Returns
number. Readable and writable.
- Works with
sound handles.
- Missing values and errors
Removed objects and unsupported handle kinds cannot supply this property.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
debug.log(speakers[0].sound.volume)
}sound.play()
Start sound playback.
- Arguments
No arguments.
- Returns
nil.
- Works with
Sound handles from audio-capable objects.
- Missing values and errors
Find the emitter before reading its sound handle. Calls affect only the current Play session.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
speakers[0].sound.play()
}sound.pause()
Pause sound playback.
- Arguments
No arguments.
- Returns
nil.
- Works with
Sound handles from audio-capable objects.
- Missing values and errors
Find the emitter before reading its sound handle. Calls affect only the current Play session.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
speakers[0].sound.pause()
}sound.stop()
Stop sound playback.
- Arguments
No arguments.
- Returns
nil.
- Works with
Sound handles from audio-capable objects.
- Missing values and errors
Find the emitter before reading its sound handle. Calls affect only the current Play session.
const speakers = find("DoorSound")
if basket.len(speakers) > 0 {
speakers[0].sound.stop()
}[BETA] marks features newer than the current public release. Current release: 0.8.0.