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.
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:
Any suggestions of where to look to fix this?
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-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.
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).