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
Contributor
Posts: 31
Registered: ‎08-30-2010
My Device: Not Specified
Accepted Solution

Live audio reading

Hi,

 

Is it possible to read live audio data (e.g. from the phone's micrphone), very much as it is possible with Android [1]? The BB/JavaME media API seems only to support post processing (and the data stored in the byte buffer is encoded with an audio codec).

 

What I need is the raw audio signal for a given period of frames (e.g. every second or so).

 

Regards,

 

 

[1] http://developer.android.com/reference/android/media/AudioRecord.html

Retired
Retired
Posts: 150
Registered: ‎10-19-2010
My Device: Not Specified

Re: Live audio reading

Hi PtSyFr!

 

The javax.microedition.media.Manager class can create you a Player to record audio.  It's RecordControl.setRecordStream will provide you access to the stream as it is recorded.  When you create the player, you can pass in extra parameters to define how often data is written to the stream and how much, in real-time.  They are documented in the Manager class under 'Custom Audio Recording Parameters'. 

 

You can specify data to be written every given milliseconds or every given number of bytes.  You can align these values with the frame size to get an exact number of frames if you need.

 

Is that what you are looking for?

Developer
Posts: 1,531
Registered: ‎07-14-2008
My Device: Z10

Re: Live audio reading

[ Edited ]

If you create your own player then you can access the raw data.

Contributor
Posts: 31
Registered: ‎08-30-2010
My Device: Not Specified

Re: Live audio reading

Hi,

 

Yes, I think this is what I am looking for.

 

Regards,