Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all articles
Browse latest Browse all 2748

Unable to start the application(0xc000007b) after including AudioEngine.h

$
0
0

@rahul_d_v wrote:

Hey all, I made a short game kinda maze type. Till now, whatever I did is fine and working. Now I want to add some sounds into it, so I Implemented AudioEngine.h But when I include AudioEngine.h, it is building successfully but after that giving runtime error 0xc000007b (unable to start the application). Currently, I am using cocos2d v4 and vs2019.
I only added these line in my code:

....
#include "audio/include/AudioEngine.h"
....

bool HelloWorld::init()
{
    if (!Layer::init())
    {
        return false;
    }

    if (AudioEngine::lazyInit())
    {
        auto musicId = AudioEngine::play2d("sounds/background music.mp3");
        AudioEngine::setVolume(musicId, 0.25f);
        CCLOG("Audio initialized successfully");
    }
    else
    {
        CCLOG("Error while initializing new audio engine");
    }
....
....
}

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 2748

Trending Articles