You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...what appears to be a basic Audio Playback usage fails on both JVM and JS (so likely in common code) with the following:
ℹ️ The sound actually does play - the crash seems to occur at completion
JVM Error
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at korlibs.audio.sound.SoundKt.getPlaying(Sound.kt:307)
at korlibs.audio.sound.SoundAudioData$play$2.getState(SoundAudioStream.kt:69)
at korlibs.audio.sound.SoundKt.getPlaying(Sound.kt:307)
at korlibs.audio.sound.SoundAudioData$play$2.getState(SoundAudioStream.kt:69)
JS Error
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at <org.chrishatton:homepage>.korlibs.audio.sound.<no name provided>.<get-state> (http://localhost:8080/homepage.wasm:wasm-function[66319]:0xb560ce)
at <org.chrishatton:homepage>.korlibs.audio.sound.<get-playing> (http://localhost:8080/homepage.wasm:wasm-function[66265]:0xb550e3)
at <org.chrishatton:homepage>.korlibs.audio.sound.<no name provided>.<get-state> (http://localhost:8080/homepage.wasm:wasm-function[66319]:0xb560f4)
at <org.chrishatton:homepage>.korlibs.audio.sound.<get-playing> (http://localhost:8080/homepage.wasm:wasm-function[66265]:0xb550e3)
at <org.chrishatton:homepage>.korlibs.audio.sound.<no name provided>.<get-state> (http://localhost:8080/homepage.wasm:wasm-function[66319]:0xb560f4)
at <org.chrishatton:homepage>.korlibs.audio.sound.<get-playing> (http://localhost:8080/homepage.wasm:wasm-function[66265]:0xb550e3)
Slightly condensed reproduction example (for usage context)
This example shows how I'm trying to use Korge with Jetpack Compose, though the actual Korge/KorAu API touch-points are probably the only significant thing:
@OptIn(ExperimentalResourceApi::class)
@Composable
fun AudioCrashExample() {
var sound: Sound? by remember { mutableStateOf(null) } // <-- Load sound
val scope = rememberCoroutineScope()
// This coroutine loads the sound (appears to work in debug)
LaunchedEffect(null) {
val soundBytes = Res.readBytes("files/button.wav")
val audioData = WAV.decode(data = soundBytes)!!
sound = nativeSoundProvider.createNonStreamingSound(audioData, "button")
}
Button(
onClick = {
scope.launch { sound?.play()?.await() } // <-- Trigger sound, this causes the crash
},
) {
Text("Play sound")
}
}
Further condensed example
Cutting out the Jetpack Compose code; this is how I'm driving Korge:
val soundBytes = Res.readBytes("files/button.wav")
val audioData = WAV.decode(data = soundBytes)!!
val sound = nativeSoundProvider.createNonStreamingSound(audioData, "button")
sound.play().await()
...this seems to be a simple example. I'm new to KorGE but a quick inspection of the JVM stack trace does make it look like a straightforward bug in its playback state management(?). Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
When using either artifact...
...or...
...what appears to be a basic Audio Playback usage fails on both JVM and JS (so likely in common code) with the following:
ℹ️ The sound actually does play - the crash seems to occur at completion
JVM Error
JS Error
Slightly condensed reproduction example (for usage context)
This example shows how I'm trying to use Korge with Jetpack Compose, though the actual Korge/KorAu API touch-points are probably the only significant thing:
Further condensed example
Cutting out the Jetpack Compose code; this is how I'm driving Korge:
...this seems to be a simple example. I'm new to KorGE but a quick inspection of the JVM stack trace does make it look like a straightforward bug in its playback state management(?). Am I doing something wrong?
The text was updated successfully, but these errors were encountered: