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: 34
Registered: ‎10-26-2010
My Device: Not Specified

AMR audio recording with 4750 bitrate

I have a java program that records 10 seconds of audio from microphone. The first version uses this string , in Manager.createPlayer()

 

final String uri = "capture://audio?encoding=pcm";

 

I have about 160.000 bytes of data after 10 seconds. Now i want to use AMR codec, so I've tried with

 

final String uri = "capture://audio?encoding=audio/amr";

 

After 10 seconds, I have about 16.000 bytes of data. If I want to use AMR with 4750 bitrate

 

 final String uri = "capture://audio?voipMode=true&encoding=audio/amr&rate=4750"

 

the data length is again about 16.000 bytes.

The  "rate" parameter doesn't work? There is anybody that use the Capture URI String with AMR and 4750 bitrate?

Developer
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: AMR audio recording with 4750 bitrate

Try encoding=amr instead of encoding=audio/amr

Contributor
Posts: 34
Registered: ‎10-26-2010
My Device: Not Specified

Re: AMR audio recording with 4750 bitrate

It doesn't  work  

Developer
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: AMR audio recording with 4750 bitrate

[ Edited ]

What device are you doing this on?

 

Can you post the first 10 bytes of audio files (for each rate) in hex here?  

Contributor
Posts: 34
Registered: ‎10-26-2010
My Device: Not Specified

Re: AMR audio recording with 4750 bitrate

First 15 bytes for PCM encoding (uhm???) 

 

000000000000000000000000000000

First 15 bytes for "capture://audio?encoding=audio/amr"

2321414D520A3C526826486519C7CC

 First 15 bytes for ""capture://audio?voipMode=true&encoding=audio/amr&rate=4750""

 

2321414D520A3C08437B404151C5CC

 

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

Re: AMR audio recording with 4750 bitrate

[ Edited ]

Hi Sarbyn!

 

For AMR encoding, using a rate that isn't 12200 kbps is only available when using voipMode (as you are doing) on CDMA devices using BlackBerry 6.0 (running build 524 later, and probably 7.0 as well - I have not tried personally).  Otherwise the 'rate=' parameter is ignored.

Contributor
Posts: 34
Registered: ‎10-26-2010
My Device: Not Specified

Re: AMR audio recording with 4750 bitrate

Only on CDMA devices?

Developer
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: AMR audio recording with 4750 bitrate

It works on GSM devices too. I think they also have to be on OS6 if I remember correctly. I will be getting back to AMR in the next few weeks and should have more info by then.