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
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to record audio?

No, It will not record the call. AFAIK there are no API's as of now.

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

Re: How to record audio?

So there are not software in the market which can record Phone Calls ?
Please use plain text.
Developer
angelo_f
Posts: 64
Registered: ‎05-06-2009
My Device: Not Specified

Re: How to record audio?

I had a play with this and I found that if you want top use the fconn.exists function you must not Open it in Connector.WRITE mode.

You open in read mode and test from there. Then close connection and open new one in write mode

This is what I did to make it work

 

          FileConnection conn = (FileConnection) Connector.open( _filename);
         
          if (conn.exists())
          {
              conn.delete();
             
          }
          conn.close();
         
          conn = (FileConnection) Connector.open( _filename, Connector.WRITE );
          conn.create();
           
          _output = conn.openOutputStream();

 

Please use plain text.
Visitor
memeyismelba
Posts: 1
Registered: ‎02-24-2010
My Device: Pearl 8220

Re: How to record audio?

I have tried almost all of code for audio recording in this forum, but my code still not working well :smileysad:

On the very first time I record, I can find the .amr file on the voice notes directory, but the recording duration showed seems different from the actual recording duration.

When I delete the first recording file and then go back to my application and record sound for the second time, I'm able to find the .amr file but the recording duration showed is 0 second, that means the application failed to keep the sound file. 

Can anyone give n hint to  solve my problem? I've tried many ways and many codes... but this are the newest code of my application:

 

 

 public void run() {
      try {          
          _player = Manager.createPlayer("capture://audio");
          _player.realize();
          recordedContentType = _player.getContentType();

          // Get the RecordControl, set the record stream,
          _rcontrol = (RecordControl)_player.getControl("RecordControl");
          
          _fileConnection = (FileConnection) Connector.open("file:///store/home/user/myfile.amr");
          
          if (_fileConnection.exists())
          {
         	 _fileConnection.delete();
             
          }
          _fileConnection.close();
          _fileConnection = (FileConnection) Connector.open( "file:///store/home/user/myfile.amr", Connector.WRITE );
          _fileConnection.create();    
          _output = _fileConnection.openOutputStream();
          _rcontrol.setRecordStream(_output);
          _rcontrol.startRecord();
          _player.start();

      } catch (final Exception e) {
         UiApplication.getUiApplication().invokeAndWait(new Runnable() {
            public void run() {
               Dialog.inform(e.toString());
            }
         });
      }
   }

 

thanks before :smileywink:

 

 

 

Please use plain text.
Developer
angelo_f
Posts: 64
Registered: ‎05-06-2009
My Device: Not Specified

Re: How to record audio?

Firstly, I do this

_player = javax.microedition.media.Manager.createPlayer("capture://audio?encoding=amr");

 

Also, try using an SD card - I had trouble just the other day where it would not let me write to internal store.

Please use plain text.
New Contributor
Pacman154
Posts: 4
Registered: ‎12-01-2009
My Device: Not Specified

Re: How to record audio?

What about me,for record audio I use Macvide Audio Recorder.It’s prog can records many different formats of sound.Try.
Please use plain text.
Developer
rajeshkparmar
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10

Re: How to record audio?

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

 

I have Create Player through this..

I am recording the sound and store in to the Device but it will display the 0 sec(it has data ) file to in it..

 

It will work fine for

_player = Manager.createPlayer("capture://audio);

 

So what is the Problem for

"capture://audio?encoding=audio/basic" locator

 

 

 


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you
Please use plain text.