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

Posts: 12
Registered: ‎06-01-2011
My Device: Blackberry Tourch
My Carrier: 3 mobile

MP3 Dilemma

Hi Folks,


I have a challenge on my hands and wanted to check in with the community before I go to the trouble of spending alot of time and losing alot of hair on my project.  I want to be sure that I am not missing a trick somewhere.


The challenge:

I came up with the idea of creating a simple audio application that would display to the user; information about the MP3 tracks on the device (track, album, track number, track length, etc).  The user could then select a track from the list and have it played back.  Eventually I would like to get to the stage where I could include a visualisation of the spectrum using DFT/FFT (another huge learning curve).


The Problem:

I am unable to find any documentation/examples/librarys that will allow me to get information about an MP3 track and likewise I cannot find anything that I can use to get information about the raw audio after it has been decoded.


Potential solution:

My gut feeling is that I am going to have to try and port over some librarys such as id3lib for reading the mp3 tags and a library like libmad to decode the mp3 so that I can get access to the raw audio data.  Having never ported any code before (and coming from a .net background where MS has been holding my hand for years) I know I am going to find all this very difficult.


Does anyone have any advice that may ease the pain or know of something I have missed that may help me with this project? All help/critism greatfully received.

BlackBerry Development Advisor
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: MP3 Dilemma

While I can't propose a solution for you, I can let you know what the state of such things is on TabletOS.


  • there IS a native media indexer which monitors the shared media directory and uses an internal metadata parser to maintain a database of metadata for the files placed there.
  • ID3 tags are supported, as well as numerous other metadata formats.
  • the PlayBook media apps (eg. Music, Pictures, Videos) make use of this database to present relevant information and artwork to the user
  • there is NO public API at this time for accessing the metadata library, which incidentally is an sqlite3 database stored in /accounts/1000/db/mmlibrary.db (accessible as db/mmlibrary.db from inside an app's sandbox)
  • since this database is undocumented, it's organization is subject to change at any time without notice, although the user_version PRAGMA could be used to detect changes to the schema
  • there WILL be a public API for accessing this data in the future, but it is under development and I cannot speculate on a date.
  • there IS an equivalent metadata indexer which runs in the Android runtime context, so if you wanted to go the Android route, you may have some success in that respect.
  • as for decoding, playing, and visualization, the QNX MultiMedia Framework is designed for this sort of thing, but the API is not publicly available
  • mmrenderer provides a public API for playing media files which internally uses the MMF for playback, with hardware acceleration, etc.  you can definitely play your audio files using this API, but you cannot access the PCM data in order to do your visualizations.
  • today, you would need to import the appropriate decoder library if you want access to the decoded PCM data.  whether you try to synchronize with mmrenderer, or you want to drive the PCM device directly would be a decision you would have to make.  the PlayWav sample shows how to drive PCM output.


Certainly what you want to try and accomplish is doable at this stage of OS API deployment, but it is not necessarily easy yet Smiley Happy





Posts: 12
Registered: ‎06-01-2011
My Device: Blackberry Tourch
My Carrier: 3 mobile

Re: MP3 Dilemma

Thanks for the detailed reply.  


I think that I may try and port the libraries I require whilst I work on other ideas/projects.  I hate the thought of being held up from learning because I get stuck on something that takes days to resolve. 


Again thanks for providing such a detailed reply. I appreciate it.