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
roxburd
Posts: 40
Registered: ‎01-14-2011
My Device: Not Specified

Is it possible to get length of audio during recording?

Hi,

I'm recording audio and I'd like to display a counter showing the length of the recording as it proceeds. I also support pause and resume - the counter should show the actual play-length of what has been recorded - i.e. the length should remain static during pause.

 

Is there any way to get the length of recorded audio (e.g. off the Player or RecordControl)  durnig a recording?

 

Advanced BlackBerry Development (Chris King) suggests you can (via PlayerListener) but the player events I get are only recordStarted and recordStopped.

 

Thanks,

Dave

Please use plain text.
Developer
sonicboomboy
Posts: 466
Registered: ‎03-04-2009
My Device: 8520
My Carrier: some

Re: Is it possible to get length of audio during recording?

you might consider using java.util.Timer to act like a counter.

Got resolved! Press kudo icon!
Please use plain text.
Contributor
roxburd
Posts: 40
Registered: ‎01-14-2011
My Device: Not Specified

Re: Is it possible to get length of audio during recording?

Thanks for teh suggestion, sonicboomboy, I'm also considering recording teh start time...

then recording duration = last_record_time - start_time - sum_of_pauses

where last_record_time = now (if recording) or time paused (if paused)

and sum_of_pauses updated every time recording resumes (sum_of_pauses += now-pause_time)

 

Apologies or excess detail - that was my design phase ;-)

 

A nice simple call on RecordController would be btter though ;-)

Please use plain text.