01-07-2013 12:08 PM
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?
01-07-2013 01:09 PM
Had the same problem... try wavs instead of MP3s
01-07-2013 01:42 PM
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
01-07-2013 01:52 PM
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.
![]()
01-08-2013 01:28 AM
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.
01-08-2013 09:32 AM
01-08-2013 09:00 PM
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.
01-08-2013 09:22 PM
"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).
01-09-2013 10:02 AM
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.
01-09-2013 11:46 AM
How should I get this app to you?