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
Highlighted
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Problem in recording wav file

Hi,

I am trying to record wave file on Blackberry device.

 

I have used following code for creatring wav file.

 

After recording, whenever I try to play it, exception is thrown as un-supported media file.

 

Please help.

p = Manager.createPlayer("capture://audio?encoding=pcm"); p.realize(); RecordControl rc = (RecordControl) p .getControl("RecordControl"); ByteArrayOutputStream output = new ByteArrayOutputStream(); rc.setRecordStream(output); rc.startRecord(); p.start(); Thread.currentThread().sleep(10000); rc.commit(); rc.setRecordLocation("file:///SDCard/BlackBerry/test.raw"); recordedSoundArray = output.toByteArray(); p.close();

 

 

 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Problem in recording wav file

Instead of test.raw, can you specify the correct format like .amr etc..

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: Problem in recording wav file

[ Edited ]

HI,

I tried with foll. extensions: .wav, .amr

Also with encoding types as x-wav, pcm

The file is generated but when I try to play it, it says unsupported format...

 

I want .wav file to be recorded. Please help....Badly stucked.... 

Message Edited by tejaswini on 08-24-2009 11:47 AM
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Problem in recording wav file

I had tried with amr recording and also teh playback, which worked fine.

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: Problem in recording wav file

May I know what encoding type you had used for .amr recording?
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Problem in recording wav file

Check this KB article.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To...


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: Problem in recording wav file

For .amr extension also, I am getting unsupported file format....

 

Please help

Smiley Sad 

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Problem in recording wav file

Just a try, Instead of setting teh location using record control, get the bytes of audio data and use those bytes to store it in a SDCard(PC) location using FileConnection API and try the created file in PC using some AMR players..

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 211
Registered: ‎04-29-2009
My Device: Not Specified

Re: Problem in recording wav file

As my project requirement is .wav file, I tried copying wave file on desktop and play with media player.

Still no luck, media player says file format not supported. Other wav files downloaded over the internet work fine with media player. 

BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Problem in recording wav file

Are you unable to play back the file on the BlackBerry smartphone when using the sample code in the knowledge base article referenced above?  If so, what BlackBerry Smartphone model and BlackBerry handheld software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.  Are you using a real BlackBerry handheld or the simulator?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.