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 Contributor
bbDeveloper237
Posts: 2
Registered: ‎06-08-2012
My Device: 9360, 9700
My Carrier: vodaphone, wind, tim

Full duplex audio streaming: pcm encoding doesn't work

Hello,

I'm trying to record and play audio (full duplex) using a pcm encoder.

 

I launch recording and it works (8000 sample/sec, 16 bit). When I launch playing however, the player asks me for 24 bytes, that I think are a request for an ".au" header (http://en.wikipedia.org/wiki/Au_file_format). Is it right? I tried to pass a correct ".au" header, but when I call player.prefetch()... recording stops to work and playing doesn't start.

 

I'm using a 9360 model (OS7).

 

Does full duplex audio work in PCM mode?

 

Which is a correct ".au" header to be passed to the player?

 

Thanks you very much in advance,

 

Ale

 

Please use plain text.
BlackBerry Development Advisor (Retired)
gsandhu
Posts: 41
Registered: ‎07-14-2008
My Device: Not Specified

Re: Full duplex audio streaming: pcm encoding doesn't work

Have you tried using AMR? To control recording latency

Controlling Record Latency:
For recording buffer size, in 5.0 codeline you can specify the recording threshold you want to use when you create your Player with some new parameters in Manager.java class javadocs:



On some BlackBerry devices, Players created for audio recording ("capture://audio")

support the following parameters:

update_method = "updateMethod=" method

method = "time" / "size"

update_threshold = "updateThreshold=" threshold

threshold = pos_integer

These parameters together specify when data is written from the Player to the recording location. If "time" is specified as the update method then threshold will be interpreted as a value in milliseconds. Valid values are from 20 - 1580 and will be rounded to the nearest 20 ms value



If "size" is specified as the update method then threshold will be interpreted as a number of bytes. Valid values are from 32 - 2528.

If these parameters are not specified or are not valid values they will be ignored, and the recording update method will remain set to the default: data will be written every 1024 bytes.

Also please note that that PCM is not supported on CDMA
http://supportforums.blackberry.com/t5/Java-Development/Record-Audio-on-a-BlackBerry-smartphone/ta-p...
Please use plain text.
Developer
Aviator168
Posts: 709
Registered: ‎09-10-2009
My Device: 8520, 8900, 9000, 9300, 9650, 9700, 9780, 9800, 9810, 9900, 9930
My Carrier: Verizon

Re: Full duplex audio streaming: pcm encoding doesn't work


gsandhu wrote:

Also please note that that PCM is not supported on CDMA
http://supportforums.blackberry.com/t5/Java-Development/Record-Audio-on-a-BlackBerry-smartphone/ta-p...


PCM is supported on CDMA as long as you are running OS7.

Please use plain text.