Closed codeniko closed 2 years ago
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)
Heh, totally forgot about that :sweat_smile:
Anyways, fixed in fc56d88e755c8c5cd823f5a1ff1c2badbc912446. 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 :star:
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.