playFromResource

fun playFromResource(key: String, volume: Double, loop: Boolean = false): SoundPlaybackResult

Play a sound from a resource key. If volume is specified then the signal can be attenuated. The volume is specified using a normalised value between 0.0 (silence) and 1.0 (no attenuation). If loop is set true the audio will loop indefinitely. Returns a result detailing if the operation was successful.