Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
battlegoat
Posts: 16
Registered: ‎01-04-2013
My Device: BB10 Dev

No sound on Release build

Everything was finally finished on our first app and I switched to a Release build, and now the sound doesn't work.

Details:

 

Sound output using MediaPlayer class in Native/c++ - mediaplayer->setSourceUrl() and mediaplayer->play()

 

Works in a Debug build, all sounds play

 

Does not work in Release build, no sounds play, but everything else works ok.

 

sounds are stored in the assets/sounds directory, the accessing url is for example:

  "asset:///sounds/snd-ss1.mp3"

 

Any suggestions of where to look to fix this?

 

Please use plain text.
Contributor
Inessa
Posts: 28
Registered: ‎11-21-2012
My Device: Playbook

Re: No sound on Release build

Had the same problem... try wavs instead of MP3s

Please use plain text.
Contributor
battlegoat
Posts: 16
Registered: ‎01-04-2013
My Device: BB10 Dev

Re: No sound on Release build

Tried with .wav files as well, same result (sound on debug, no sound on release).

 

I saw on another thread that there is a problem with .mp3 files on the simulator, but this testing is with a Dev Alpha A device, and in debug mode the .mp3 files work.

 

But in release mode, no sound, neither .mp3 nor .wav

 

 

Please use plain text.
Contributor
Inessa
Posts: 28
Registered: ‎11-21-2012
My Device: Playbook

Re: No sound on Release build

Now I have problems with images... one of them is displaying on the BB10 simulator but not displaying in the release build on a  device.

 

:Sweatdrop:

Please use plain text.
Contributor
battlegoat
Posts: 16
Registered: ‎01-04-2013
My Device: BB10 Dev

Well, I tried everything I possibly could think of, inclu...

Well, I tried everything I possibly could think of, including paths, bar-descriptor changes, file formats, naming, etc etc.  Definitely is some sort of error in MediaPlayer when called from C++ in a release build.  Probably explains why there are no C++ examples in the docs or the example files - only qml examples exist.

 

In the end I switched to OpenAL, though it's not the greatest choice because (a) there's no mp3 support, and (b) its not well threaded so it causes a blocking delay on playing sounds.

 

Definitely an issue in the Gold SDK on MediaPlayer in release mode.

 

-- George.

 

Please use plain text.
Developer
TobyKaos
Posts: 78
Registered: ‎12-12-2012
My Device: playbook

Re: Well, I tried everything I possibly could think of, inclu...

maybe a wrong setup in bar descriptor for your release assets?

for image maybe a non power of 2 image?
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: No sound on Release build

have you tried unzipping the release .bar file to see if the files are actually there?

the fact that it works in your debug build is interesting.

Please use plain text.
Contributor
battlegoat
Posts: 16
Registered: ‎01-04-2013
My Device: BB10 Dev

Re: No sound on Release build

"have you tried unzipping the release .bar file to see if the files are actually there?"

 

Yup, tried that.

 

And as a double-confirmation, the OpenAL routine correctly plays the exact .wav sound files (in release build) that the MediaPlayer interface refuses to play, so the files must be there OK.

 

Given the fact that there is no documentation on using the MediaPlayer class in C++ on the developer site, and there are no example programs that use it, my guess is that people just haven't been using it, and so it's an SDK bug of some sort.  (there are MediaPlayer examples in qml, which apparently work ok, but no examples in c++ - The only way to figure out how to use the class was the comments in the header files).

 

 

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: No sound on Release build

if you can boil this down to a minimalist sample app with one wav file and the code that tries to play it but fails, I will talk to the multimedia lead about it.

Please use plain text.
Contributor
battlegoat
Posts: 16
Registered: ‎01-04-2013
My Device: BB10 Dev

How should I get this app to you?

How should I get this app to you?

 

Please use plain text.