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

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Flac Audio format

I have seen this Flac audio format is supported, but how is possible to save or convert audio to this format?  I was thinking I would be lucky and I tried to save it doing this:

 

Manager.createPlayer("capture://audio?encoding=audio/flac");

but i get javax.microedition.media.MediaException: Unsupported record encoding type


The other option would be to convert to flac format. Any ideas?

 


Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Flac Audio format

I don't think FLAC is supported, at least not natively. Where did you read FLAC was supported? Using another format is probably what you have to do. I would probably want to avoid doing conversion at runtime if I could, because audio conversion can be quite costly unless you are dealing with short audio clips.

 

Scott

Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Flac Audio format

[ Edited ]

Thanks for your answer. I read it here...
http://docs.blackberry.com/en/developers/deliverables/36459/Supported_audio_formats_1792778_11.jsp

So it must be supported.

 

The thing is I really need the audio in this format.

Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Flac Audio format

And now I just played an flac audio file in my blackberry, so it's really supported. But what I need it's to record audio in this format or at least convert it.
Highlighted
Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Flac Audio format

[ Edited ]

Thanks for the link. I never new FLAC was supported for playback.

 

I ran javax.microedition.media.Manager.getSupportedContentTypes("capture"); on the 9860, and FLAC is not listed as a supported type for capturing. On the 9860, these are the supported content types for capture:

 

audio/amr

audio/basic

audio/x-gsm

 

It seems FLAC is not available for recording.

 

Scott

Developer
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Flac Audio format

Thanks for your answer. Now that it's clear I can't record in this format, I am trying to figure out if I can convert audio to this format either in my device (javame) or in a server (javase).  If you have any clue about it let me know.

Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Flac Audio format

[ Edited ]

You can try to write the encoder yourself and put it into your code, but this might be challenging.You might find public domain code that you can use. There are flac libraries for Java out there. Whether or not they can be included into your BB project as is, I am not sure.

 

If you are doing audio recording on BB, you will run into an issue. The only capture format supported on every device is AMR, which is encoded with compression and there is no AMR decoder in the BB API. For audio manipulation, audio/basic is a great option because it is raw PCM, however it is only available on probably 65% (rough estimate) of the devices out currently. I bring this up because if you are thinking about writing or using a FLAC encoder, which recording method you use is going to affect your work greatly. Using AMR to record will require you to decode to PCM (or some baseline) first, and then encode to FLAC. You will probably have to write the AMR decoder yourself. So if you are planning to write or include a FLAC encoder, you have to decide if you are also going to write an AMR decoder or use audio/basic and reach less users.

 

Another option is to upload an AMR file to a webserver and have the server run FFMPEG or something similar. Not a bad option, considering it saves you thousands of lines of code and the processor consumption for the user. There's obvious costs involved with maintaining a server like this, however.

 

Scott