Audio:play*, with controls for transport and volume.
Fields
volume
volume of the sound.
Methods
stop
fadeToStopTime PCM frames. Omit it
to stop at once.
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Audio:play*, with controls for transport and volume.
volumefunction update(self: AudioScript)
-- updates the volume for AudioSound playback when the input is changed
if self.soundInstance then
self.soundInstance.volume = self.volumeNumber / 100
end
end
stopstop(fadeToStopTime: number?) -> ()
fadeToStopTime PCM frames. Omit it
to stop at once.
function stopSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:stop()
end
end
seekseek(seconds: number) -> boolean
if self.soundInstance then
self.soundInstance:seek(self.seekSeconds)
end
seekFrameseekFrame(frame: number) -> boolean
if self.soundInstance then
self.soundInstance:seekFrame(self.seekFrameNumber)
end
completedcompleted() -> boolean
function advance(self: AudioScript, seconds: number): boolean
if self.soundInstance then
self.isCompleted = self.soundInstance:completed() -- whether playback has finished
end
return true
end
timetime() -> number
function advance(self: AudioScript, seconds: number): boolean
if self.soundInstance then
self.currentTime = self.soundInstance:time() -- current playback time in seconds
end
return true
end
timeFrametimeFrame() -> number
function advance(self: AudioScript, seconds: number): boolean
if self.soundInstance then
self.currentTimeFrame = self.soundInstance:timeFrame() -- current playback time in PCM frames
end
return true
end
pausepause() -> ()
function pauseSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:pause()
end
end
resumeresume() -> ()
function resumeSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:resume()
end
end
playplay() -> ()
function playSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:play()
end
end
Was this page helpful?