Audio

actual class Audio : AudioBuilder

Play audio from a url (String).

Example:

val audioUrl = "https://dare.wisc.edu/wp-content/uploads/sites/1051/2008/11/MS072.mp3"
val audio = Audio(audioUrl, true) // AutoPlay is marked "true"
actual class Audio

Play audio from a url (String).

Example:

val audioUrl = "https://dare.wisc.edu/wp-content/uploads/sites/1051/2008/11/MS072.mp3"
val audio = Audio(audioUrl, true) // AutoPlay is marked "true"
expect class Audio

Play audio from a url (String).

Example:

val audioUrl = "https://dare.wisc.edu/wp-content/uploads/sites/1051/2008/11/MS072.mp3"
val audio = Audio(audioUrl, true) // AutoPlay is marked "true"
actual class Audio : AudioBuilder
actual class Audio : AudioBuilder
actual class Audio : AudioBuilder

Constructors

Link copied to clipboard
actual constructor(resource: String, autoPlay: Boolean)
actual constructor(context: Any?, composeResource: String, autoPlay: Boolean)
actual constructor()
actual constructor(resource: String, autoPlay: Boolean)
actual constructor(context: Any?, composeResource: String, autoPlay: Boolean)
actual constructor()
expect constructor(resource: String, autoPlay: Boolean = false)

Play audio from a url or path (String).

expect constructor(context: Any?, composeResource: String, autoPlay: Boolean = false)

Play audio from a url or path (String).

expect constructor()
actual constructor(resource: String, autoPlay: Boolean)
actual constructor(context: Any?, composeResource: String, autoPlay: Boolean)
actual constructor()
actual constructor(resource: String, autoPlay: Boolean)
actual constructor(context: Any?, composeResource: String, autoPlay: Boolean)
actual constructor()
actual constructor(resource: String, autoPlay: Boolean)
actual constructor(context: Any?, composeResource: String, autoPlay: Boolean)
actual constructor()

Properties

Link copied to clipboard
actual open override val audioState: StateFlow<AudioState>

common sealed class that provides the state of Audio after initialization

actual open val audioState: StateFlow<AudioState>
expect val audioState: StateFlow<AudioState>

Provides the state of Audio after initialization

actual open override val audioState: StateFlow<AudioState>

common sealed class that provides the state of Audio after initialization

actual open override val audioState: StateFlow<AudioState>

common sealed class that provides the state of Audio after initialization

actual open override val audioState: StateFlow<AudioState>

common sealed class that provides the state of Audio after initialization

Link copied to clipboard
actual var autoPlay: Boolean
actual var autoPlay: Boolean
expect var autoPlay: Boolean

If true, Audio runs play immediately after reaching AudioState.READY

actual var autoPlay: Boolean
actual var autoPlay: Boolean
actual var autoPlay: Boolean
Link copied to clipboard
actual var resource: String
actual var resource: String
expect var resource: String

A url link as a string:

actual var resource: String
actual var resource: String
actual var resource: String

Functions

Link copied to clipboard
actual open override fun load(context: Any?)

Used to load an Audio file when AudioState.NONE.

actual open fun load(context: Any?)
expect fun load(context: Any? = null)

Used to load an Audio file when AudioState.NONE.

actual open override fun load(context: Any?)

When overridden, used to load an Audio file when AudioState.NONE.

actual open override fun load(context: Any?)

When overridden, used to load an Audio file when AudioState.NONE.

actual open override fun load(context: Any?)

When overridden, used to load an Audio file when AudioState.NONE.

Link copied to clipboard
actual open override fun pause()

When overridden, used when Audio is AudioState.PLAYING to pause the sound to be continued later.

actual open fun pause()
expect fun pause()

Used when Audio is AudioState.PLAYING to pause the sound to be continued later.

actual open override fun pause()

When overridden, used when Audio is AudioState.PLAYING to pause the sound to be continued later.

actual open override fun pause()

When overridden, used when Audio is AudioState.PLAYING to pause the sound to be continued later.

actual open override fun pause()

When overridden, used when Audio is AudioState.PLAYING to pause the sound to be continued later.

Link copied to clipboard
actual open override fun play()

When overridden, used after Audio is initialized with AudioState.READY to play the sound immediately.

actual open fun play()
expect fun play()

Used after Audio is initialized with AudioState.READY to play the sound immediately.

actual open override fun play()

When overridden, used after Audio is initialized with AudioState.READY to play the sound immediately.

actual open override fun play()

When overridden, used after Audio is initialized with AudioState.READY to play the sound immediately.

actual open override fun play()

When overridden, used after Audio is initialized with AudioState.READY to play the sound immediately.

Link copied to clipboard
actual open override fun release()

When overridden, used when done to clear the Audio object from memory.

actual open fun release()
expect fun release()

Used when done to clear the Audio object from memory.

actual open override fun release()

When overridden, used when done to clear the Audio object from memory.

actual open override fun release()

When overridden, used when done to clear the Audio object from memory.

actual open override fun release()

When overridden, used when done to clear the Audio object from memory.

Link copied to clipboard
actual open override fun stop()

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

actual open fun stop()
expect fun stop()

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

actual open override fun stop()

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

actual open override fun stop()

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

actual open override fun stop()

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