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'm using libgdx's AndroidFragmentApplication and my game needs to play a looped background music piece as soon as the game loads. The issue is no music or sounds get played for the entire time the app is in foreground until you put app in background, and then back into foreground. Once it's in foreground for the second time, then music and sounds start playing without me having to invoke play() on any of them. I'm using the latest libgdxoboe 0.2.4.
Not sure if this is an issue related to using AndroidFragmentApplication instead of your README's AndroidApplication but the fix is to invoke resume() after creating the OboeAudio instance. I'm assuming the issue resolves itself when you bring app back into foreground a second time because resume gets invoked automatically. Just not that first time.
Note this wasn't something I had to do with Libgdx's default AndroidAudio.
Hmm. It's probably because of the new fragment class, yes. I need to look into that, I assume something in music lifetime changed in recent libGDX versions (and I didn't reflect those changes, as I haven't worked with libGDX in a while)
Anyways, fixed in fc56d88. There were some lifetime shenanigans in the earliest days of the lib, somehow I missed the basic step of resuming the default audio engine on start. Thanks for reporting ⭐
If there are still problems, don't hesitate to reopen this issue. I've never worked with fragments, so I'm not sure if libgdx-oboe is 100% compatible with them as of now
I'm using libgdx's
AndroidFragmentApplication
and my game needs to play a looped background music piece as soon as the game loads. The issue is no music or sounds get played for the entire time the app is in foreground until you put app in background, and then back into foreground. Once it's in foreground for the second time, then music and sounds start playing without me having to invokeplay()
on any of them. I'm using the latest libgdxoboe 0.2.4.Not sure if this is an issue related to using
AndroidFragmentApplication
instead of your README'sAndroidApplication
but the fix is to invokeresume()
after creating theOboeAudio
instance. I'm assuming the issue resolves itself when you bring app back into foreground a second time becauseresume
gets invoked automatically. Just not that first time.Note this wasn't something I had to do with Libgdx's default AndroidAudio.
The text was updated successfully, but these errors were encountered: