Crash on AudioEngine trying to play OGG sound - Cocos2d-x 4.0

I am making a magic game and I am trying to play an OGG sound. If I use AudioEngine::play2d("spellCast.ogg", false, 1.0f, nullptr); my game freezes and doesn’t play the sound. If I do the same, except with an MP3 file AudioEngine::play2d("menuTheme.mp3", true, 1.0f, nullptr);, it works file

You should really have the docs and API reference handy when coding.

This tells you why.

I took a look at it, but I’m still confused. In the game “Geometry Dash,” I’ve seen .ogg files inside the files of the game and I’ve heard them in the game

wait i just noticed that Geometry Dash uses FMOD not AudioEngine

Hold on guys I been working with the audio recantly let me tell you the engine has no problem playing any formats it’s your hardware configuration. Now run that same code not I’m emulate run it on the tablet it’s self Oh this is going to bake you noodle, took me days to figure this this out.

Running on emulator sometimes even gave me errors then I accidentally ran it on the table and then found out. I had no problem with WAV FLAC MP3 OGG AAC A4C
all formats played I’m using Samsung A7 2020 model and old Tesco huddl 2 LOL
it’s for testing only…!

Hope this help.
maybe I could put a demo of what the engine can do.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.