Audio

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).

Parameters

resource

provides the link to the audio file online

autoPlay

play after AudioState.READY is reached (defaults to "false").

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 constructor(context: Any?, composeResource: String, autoPlay: Boolean = false)

Play audio from a url or path (String).

Parameters

context

provide the Platform Context (this is mostly to accommodate Android)

composeResource

provides the link to the audio file online

autoPlay

play after AudioState.READY is reached (defaults to "false").

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 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()