ruwinmike
12/28/2020, 2:44 PMval tone = AudioTone.generate(1.seconds, 440.0)
val sound = tone.toSound()
sound.playAndWait { current, total ->
println("current $current and total $total")
}
But crash with
java.lang.IllegalStateException: Can't find the Android Context on the CoroutineContext. Must call withAndroidContext first
at com.soywiz.korau.sound.AndroidNativeSoundProvider.createAudioStream(AndroidNativeSoundProvider.kt:28)
at com.soywiz.korau.sound.SoundAudioStream.play(SoundAudioStream.kt:24)
at com.soywiz.korau.sound.Sound.playAndWait(Sound.kt:231)