stop

actual open override fun stop()

When overridden, used to reset the Audio without reloading from the sound file.

Sets the audioState to AudioState.READY

Example:

val audio = Audio(audioUrl) // AutoPlay defaults to "false"
audio.play() // plays the sound immediately
// more code
audio.stop() // now ready to play from the beginning again
actual open fun stop()
expect fun stop()

Used to reset the Audio without reloading from the sound file.

Sets the audioState to AudioState.READY

Example:

val audio = Audio(audioUrl) // AutoPlay defaults to "false"
audio.play() // plays the sound immediately
// more code
audio.stop() // now ready to play from the beginning again
actual open override fun stop()

When overridden, used to reset the Audio without reloading from the sound file.

Sets the audioState to AudioState.READY

Example:

val audio = Audio(audioUrl) // AutoPlay defaults to "false"
audio.play() // plays the sound immediately
// more code
audio.stop() // now ready to play from the beginning again
actual open override fun stop()

When overridden, used to reset the Audio without reloading from the sound file.

Sets the audioState to AudioState.READY

Example:

val audio = Audio(audioUrl) // AutoPlay defaults to "false"
audio.play() // plays the sound immediately
// more code
audio.stop() // now ready to play from the beginning again
actual open override fun stop()

When overridden, used to reset the Audio without reloading from the sound file.

Sets the audioState to AudioState.READY

Example:

val audio = Audio(audioUrl) // AutoPlay defaults to "false"
audio.play() // plays the sound immediately
// more code
audio.stop() // now ready to play from the beginning again