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

Reply
New Developer
Posts: 108
Registered: ‎01-23-2012
My Device: torch,bold,curve,strom
My Carrier: Blackberry
Accepted Solution

Audio Recording Problem

Hi all,

Can any one suggest me the code to implement audio recording!

 

How to implement audio recording!

Thanks & Regards,
Kumar Shivam
Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

Re: Audio Recording Problem

HI Shivam

plz check this link for audio recording


http://supportforums.blackberry.com/t5/Java-Development/Record-Audio-on-a-BlackBerry-smartphone/ta-p...
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

Re: Audio Recording Problem

Hi,

 

Check this code it will work.

 

 
try{
            player = Manager.createPlayer("capture://audio?encoding=amr");
            player.realize();
            
            rc = (RecordControl)player.getControl("RecordControl");
            bt = new ByteArrayOutputStream();
            rc.setRecordStream(bt);
            fc = (FileConnection)Connector.open("file:///store/home/user/RecordedFiles/audio1.amr");
            if(!fc.exists()){
                fc.create();
            }
           ot = fc.openDataOutputStream();
            rc.setRecordStream(ot);
            rc.startRecord();
            player.start();   

           
            }catch(Exception e){
                e.printStackTrace();
            }
 

 

 

 

 

 

-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
New Developer
Posts: 108
Registered: ‎01-23-2012
My Device: torch,bold,curve,strom
My Carrier: Blackberry

Re: Audio Recording Problem

Thanks Brajesh,

 Thanks for your reply it works !

 

Thanks for your valuable suggestion!

Thanks & Regards,
Kumar Shivam
Developer
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10
My Carrier: Vodafone, Airtel

Re: Audio Recording Problem

Hi Shivam284,

if this works fine that plz accept as solution.
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Highlighted
Contributor
Posts: 43
Registered: ‎11-24-2011
My Device: Perl
My Carrier: BB

Re: Audio Recording Problem



Here I give a sample program example which will recode the audio and saved it on server and play from it

http://blackberryaudiorecording.blogspot.in/