Music not working

Hi, what’s the correct way of playing music on QNX? Wav(16/24/32bit) nor mp3 work. Do you have to specify something? Is it related to codecs?

Dear ,

You can refer to the sample “Play Wav” which can be created by “File > New Example” in PlayBook NDK environment.

Oh well, that thing has 400 lines… Okay… But if you ask me it’s much more complicated then it should be.

Dany Menko wrote:

Hi, what’s the correct way of playing music on QNX? Wav(16/24/32bit) nor mp3 work. Do you have to specify something? Is it related to codecs?

You have to call the effect file with this method.
SimpleAudioEngine::sharedEngine()->playEffect(std::string(CCFileUtils::fullPathFromRelativePath(“yourSound.wav”)).c_str());

AND

you have to preload effect and bgm in advance. Or it will not playing.

I’m using 22050 khz, 16 bit wav. Sometimes the the compression not supported (same WAV format, different compression algorithm maybe…), so you have to try it by yourself.

For the Background Music, you can use mp3 to minimize the build size.

I found that .mp3 files weren’t supported in cocos2d-x 2.x, but .ogg was. Have a look in CocosDenshion/blackberry/SimpleAudioEngine.cpp. After converting all of my .mp3s to .ogg it worked fine on BB10.

Ben