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

Web and WebWorks Development

Reply
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

audio latency

I added keyboard audible feedback to my calculator last night. I use an audio object with a tiny mp3 and use audioobject.play() in the ontouchend for the keyboard. It works ok but not as accurately as the os keyboard. It sometimes misses a sound when typing fast. Any way to make it spot on responsive? The palm webos api has a special low latency system call that makes these sounds effects have zero latency. Is something like that planned for WebWorks?

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Contributor
slondell
Posts: 33
Registered: ‎02-23-2011
My Device: PlayBook

Re: audio latency

Hey TheMarco! Fellow webOS'er here too... Are you using the 2.0 simulator? I need to add sound myself! Thanks
--------------------------------------
ABC Trace for BlackBerry PlayBook
Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: audio latency

Yep, latest simulator. the latency in the simulator is significantly crappier than on a real device. That said, it's still there on the device and I'd like it not to be. This was the same on WebOS b.t.w. the only sounds that have zero latency are the ones played through that special system call. It's also a limited amount of built-in OS sounds. I'd be happy with that though. No problem using the stock keyboard sound.

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Contributor
slondell
Posts: 33
Registered: ‎02-23-2011
My Device: PlayBook

Re: audio latency

Thanks for info - I'll give it a try!
--------------------------------------
ABC Trace for BlackBerry PlayBook
Please use plain text.
Developer
billfoust
Posts: 382
Registered: ‎05-19-2008
My Device: BlackBerry Torch

Re: audio latency

The AudioPlayer has some problems with looping sounds with an unavoidable delay. These might be related. Also, are you initializing the Player object each time, or are you able to keep an object loaded and initialized at all times?

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: audio latency

There's only one object and I simply call object.play() when needed.

It's WAY too laggy. Completely unsuitable for game sounds or keyboard feedback. The keyboard audio in my calculator sucks because of this lag.

 

I'm wondering if I should just take it out again before people start lowering their reviews because of this lag...

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: audio latency

*bump*

 

I'd like to see some kind of response from RIM here...

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: audio latency

Hey Marco,

 

Can you confirm the lag is on the simulator only, or are you seeing the same results on a live device?  I myself have noticed that content running in the PlayBook sim can appear to run slower than on a live device.

 

Although the same Tablet OS is used on both the live devices an sim, the sim is older and so may still have older bugs.

 

If do you suspect this is a defect, can you please get a defect logged  https://www.blackberry.com/jira/secure/Dashboard.jspa)? Then it would make it easier to escalate internally and have it looked into.  

 

Cheers,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: audio latency

[ Edited ]

Hey Adam,

 

The lag is horrible on the simulator and slightly less horrible on the real device. Still it's definitely there and people notice it. My app has very few event listeners but yet it manages to act quite laggy. Recently when I added sound this lag got amplified. When the user types somewhat fast (not ridiculously fast, just doable fast) the audio can't keep up with the keypresses which results in a pretty crappy experience. I wanted to add audio feedback to keypresses and expected it to be just as snappy as the built in keyboard. It's far from it.

 

Note that I have seen this exact same problem on Palm WebOS. The Palm solution to it was to offer a special API call that would play a sound from a limited set of predefined system sounds. For the PlayBook it would be awesome if there was such a call that would play the same sound you hear when using the regular keyboard on the PlayBook. This system call that Palm provided allowed me to have lag-free audio feedback when pressing keys.

 

Anyway, as you understand from this, it's not really a defect. It's just something that's a bit crappy in just about any browser, even desktop ones. So I suppose my request is more of a feature request rather than a bug/defect report.

 

So, ideally there would be some call in the WebWorks API that plays a system sound with 'top priority' when called. This would enormously enhance user experience in many apps that have their own on-screen keyboard.

 

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.
Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: audio latency

More audio woes.

When using HTMLAudioObject.play() any music that may be playing in the background with the PlayBook music player STOPS?!?!

 

Filed a bug in the issue tracker:

 

https://www.blackberry.com/jira/browse/WEBAPI-124

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Please use plain text.