Problem running background music

Im trying to run a mp3 sound for the background music. I consulted the test project and it was fairly simple.
But when I include SimpleAudioEngine.h the library is not found. Due to which basically I can’t do anything.

What might be the problem.
Thanks

Okie I’ve got it. I forgot to add CocosDenshion as subproject and in the res module path in the mkb.
The mistakes I made… :stuck_out_tongue:

How do you loop the background music. I passed the second parameter as true yet it didn’t loop.

I take a look at CocosDenshion/airplay/SimpleAudioEngine.cpp

    void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
    {
        s3eResult result;

        result = s3eAudioPlayFromBuffer(g_AudioBuffer, g_AudioFileSize, bLoop);

        if ( result == S3E_RESULT_ERROR)
        {
            if (bLoop)
            {
                result = s3eAudioPlay(pszFilePath, 1000000);
            }
            else
            {
                result = s3eAudioPlay(pszFilePath, 0);
            }
        }

        if ( result == S3E_RESULT_ERROR) 
        {
            IwAssert(GAME, ("Play music %s Failed. Error Code : %s", pszFilePath, s3eAudioGetErrorString()));
        }
    }

As you said, the 2nd param of s3eAudioPlay doesn’t work?

Yeah it doesn’t. I went through this piece of code too when debugging. The music simply doesn’t loop back.

Well, I find the document of s3eAudioPlay here
http://www.madewithmarmalade.com/devnet/docs#/api/api/group__audioapigroup.html

S3E_API s3eResult s3eAudioPlay  ( const char *      filename,
                                          uint32            repeatCount  
                                            )           

Plays an audio file from the file system.

Parameters:
        filename    Name of file to play.
        repeatCount     one of the following values: 0 = Play forever, 1 = Play once, >1 = Play a certain number of times.

So should we change our code to

            if (bLoop)
            {
                result = s3eAudioPlay(pszFilePath, 0);
            }
            else
            {
                result = s3eAudioPlay(pszFilePath, 1);
            }

Can you have a try?

I tried the above code. Still no luck.