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
Posts: 7
Registered: ‎08-15-2011
My Device: Torch, Bold, Curve etc
My Carrier: n/a

Determining exact audio playback position on OS6 devices using DataSource

We’re using a datasource to feed streaming AMR samples to the speaker. Especially on OS6 we’re experiencing some difficulties with the audio.

 

Because it’s important for us to have low latency between receiving the sample from the network and playing it out on the speaker/earpiece, we want to minimize the amount of samples in blackberry’s internal playback buffer. In OS7 we’re using the setBufferTime on the StreamingBufferControl to minimize this amount. On OS6 we don’t have this feature and we have an initial buffer of approx. 125 samples that we need to feed to the datasource before we hear anything playing. Once we know this, we can block the read function and let the buffer drain to an acceptable amount of let’s say 400 milliseconds of audio data. This works for 90% of the time, in some cases there’s let’s say 200 msec of data in the buffer and other cases for example 1200 msec. So the real problem is that we do not know when the speaker is playing it’s samples.

 

We looked at several events from the playerUpdate function like MediaTime and buffering started and buffering stopped events in order to determine the exact playback position but all of them seem not that accurate.

 

When a garbage collect comes in we restart the procedure and fill the initial buffer again to start playing as soon as possible and we also immediately drain this buffer again to an acceptable amount. In these cases we use the same procedure as when we “normally” start audio playback and we experience the same issues that we don’t know exactly how much samples are in blackberry’s internal playback buffer.

 

Regards,

Contributor
Posts: 14
Registered: ‎04-23-2012
My Device: Bold
My Carrier: 2063103963

Re: Determining exact audio playback position on OS6 devices using DataSource

Any response from RIM on this?  We're having the exact same issue on OS6 and its near impossible to force our customers to upgrade to OS7.

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

Re: Determining exact audio playback position on OS6 devices using DataSource


James1975 wrote:

 

When a garbage collect comes in we restart the procedure and fill the initial buffer again to start playing as soon as possible and we also immediately drain this buffer again to an acceptable amount. In these cases we use the same procedure as when we “normally” start audio playback and we experience the same issues that we don’t know exactly how much samples are in blackberry’s internal playback buffer.

 

Regards,


You can destroy the player and start over.