02-09-2012 09:07 PM - edited 02-09-2012 09:13 PM
I looked at the PlayWav and PlayAudio samples, it looks like there are a thousand lines just to play a single audio file.
As a programmer, I shouldn't have to worry about the underlying implementation of the code to achieve the need functionality.
Is there a helper library that simplifies loading and playing of audio files?
02-10-2012 04:11 PM
The PlayWav sample uses less than 200 lines of code including opening and parsing the WAV headers, and is a pretty low-level implementation. This is the sort of thing someone would use for playing sound effects in a game. You would write this function once, and call it with different WAV buffers. If you know your sample rates, etc. ahead of time, then you can skip half of the code. The example is generic enough to be more flexible than that.
If all you want to do is play an audio file (eg. the user selects an mp3 and you play it for them), you can use the mm-renderer interface which the PlayAudio sample code uses. The code is only about 10 lines to open mm-renderer and pass it a URL to the file you want to play.
So different use-cases require different levels of implementation complexity. It just depends on what you are trying to accomplish.
02-10-2012 07:12 PM - edited 02-10-2012 07:19 PM
I'm trying to play an mp3, without knowing any of it's technical details.
How can I include the mmrenderer / any extra library to a new project in QNX Momentics IDE? It fails to compile because it can't find the symbols. 'undefined reference to mmr_...'
03-04-2012 09:50 AM
I have tested with "Play Wav" test project bundle with the IDE and can't hear any sound playing by the simulator.
I successfully compiled and load into a simulator.
Do you have any suggestion ?
03-05-2012 04:29 PM
What version of the NDK and simualtor did you try this on? 18.104.22.16871? You may have to adjust the volume settings in the "Sounds and Notifications" options menu.