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
I noticed that i need to load all assets inside a suspend function (eg. suspend fun VfsFile.readAudioData). But is this also necessary for playing a sound (.toNativeSound().play())? If I want to play a sound deep in my game logic, I have to make all functions on this way to a suspend function. But this seems to be even impossible if I want to trigger a sound during a KeyEvent, because the fun onKeyEvent(views: Views, event: KeyEvent) has no suspend.
So did I missed something in coroutines, korge or the KorAU API or is this the recommend way to only write suspend methods?
Btw.: The https://forum.soywiz.com seems to be down, which would be a better place for my question.
If I get it out, I could also help to improper the documentation.
The text was updated successfully, but these errors were encountered:
I have fixed forum.soywiz.com already. It was not configured to start on reboot, and that's why it was down.
Typically you won't use readAudioData (unless you want to read or manipulate the data) but readNativeSound that returns a native sound ready to play. It seems that the documentation misses that part.
I noticed that i need to load all assets inside a suspend function (eg.
suspend fun VfsFile.readAudioData
). But is this also necessary for playing a sound (.toNativeSound().play()
)? If I want to play a sound deep in my game logic, I have to make all functions on this way to a suspend function. But this seems to be even impossible if I want to trigger a sound during aKeyEvent
, because thefun onKeyEvent(views: Views, event: KeyEvent)
has no suspend.So did I missed something in coroutines, korge or the KorAU API or is this the recommend way to only write suspend methods?
Btw.: The https://forum.soywiz.com seems to be down, which would be a better place for my question.
If I get it out, I could also help to improper the documentation.
The text was updated successfully, but these errors were encountered: