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
Developer
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified
Accepted Solution

How to record audio?

I have a couple of questions on this score.  

 

#1.  What are the APIs to record audio?  

#2.  How do I save the audio (e.g. in what format?) and how do I specify the media to save the audio to?

#3.  Is it possible to be recording audio while the application is not in the foreground?  Is there anything special I have to do?

#4.  Is it possible to record calls?  

 

Thanks. 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to record audio?

Check the link below:

 

How to record audio on BB

Developer
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified

Re: How to record audio?

Ok, I implemented the code, but where is the recorded data?
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to record audio?

Associate output stream with a file (use FileConnections API, available since RIM API 4.2) on device memory/sd-card before recording.

 

And when you close the stream the file will contain the recorded data.

Developer
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified

Re: How to record audio?

I am kind of new to this.  Do you have an example of how to associate a file with an output stream?
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to record audio?

String url = "file:///SDCard/BlackBerry/Music/myfile.dat" FileConnection conn = (FileConnection) Connector.open( url, Connector.WRITE ); if( !conn.exists() ){ // create the file conn.create(); OutputStream _output = conn.openOutputStream(); // use output stream as it is shown in the sample .... _rcontrol.setRecordStream(_output); ..... }

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to record audio?

Also check this link

 

There is helpful information for beginners.

New Developer
Posts: 2
Registered: ‎05-11-2009
My Device: Not Specified

Re: How to record audio?

I have implemented the code from the example, as well as the code to write the audio data to a file, but when I execute the run method an error pops up.

 

The error is: javax.microedition.io.file.IllegalModeException: Access mode read required

 

I am testing this on a BlackBerry 9000 v4.6.0.167 using JDE 4.7

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

Re: How to record audio?

Have you opened it in "WRITE" Mode?

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

Re: How to record audio?

[ Edited ]

Will capture://audio also record the Phone Calls. Will it be able to record the opposite person conversatio.

 

 

If not then how can I record a Phone Call.

 

 

Thanks...

Message Edited by safycool on 08-04-2009 02:00 AM