Documentation Index
Fetch the complete documentation index at: https://rive-accessibility.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
A playback instance returned by Audio:play*, with controls for transport and volume.
Fields
volume
volume of the sound.
function 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
Methods
stop
stop(fadeToStopTime: number?) -> ()
stop the audio
function stopSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:stop()
end
end
seek
seek(seconds: number) -> ()
seek the audio to a specific time in seconds.
if self.soundInstance then
self.soundInstance:seek(self.seekSeconds)
end
seekFrame
seekFrame(frame: number) -> ()
seek the audio to a specific time in PCM frames.
if self.soundInstance then
self.soundInstance:seekFrame(self.seekFrameNumber)
end
completed
Whether the sound has completed playing.
function advance(self: AudioScript, seconds: number): boolean
if self.soundInstance then
self.isCompleted = self.soundInstance:completed() -- whether playback has finished
end
return true
end
time
Current sound time in seconds.
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
timeFrame
Current sound time in PCM frames.
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
pause
pauses the audio.
function pauseSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:pause()
end
end
resume
resumes the audio from its current position.
function resumeSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:resume()
end
end
play
plays the audio.
function playSound(self: AudioScript)
if self.soundInstance then
self.soundInstance:play()
end
end