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
New Contributor
Posts: 7
Registered: ‎06-17-2013
My Device: Developer
My Carrier: 8172660366
Accepted Solution

HTML5 Microphone API NullPointerException Bug.

From what I can tell, the example program for the microphone API - https://developer.blackberry.com/html5/apis/blackberry.media.microphone.html

 

will always have an uncaught NullPointerException on the function "RecordPlayer.writeSavedData()" line:1197 when you use Blackberry JDE 7.1.0. It will still record the file, but will have the exeption first. I tried on a previous version, 6.0.0, and it worked fine. I heard it even worked on 7.0.0. Does anyone know a solution to this? I think it's a bug, or it may just be a problem with the sample code. 

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: HTML5 Microphone API NullPointerException Bug.

what exception do you see?

 

What device model and OS version are you using?  I seem to recall the microphone API behaving differently depending on which type of CPU the device had. Its been a while but I remember troubleshooting an issue like this years ago and it turned out the format of the file being created was the culprit (incompatibility issue).

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 7
Registered: ‎06-17-2013
My Device: Developer
My Carrier: 8172660366

Re: HTML5 Microphone API NullPointerException Bug.

I finally managed to find that it was a section of code in the 'stop' function in Record.java. I'm not sure if this will break some function of the Microphone API, but I just commented out this:

 

// Stop recording, close the OutputStream and player.
/* if( _rcontrol != null ) {
try {
_rcontrol.commit();
} catch( IOException e ) {
MicrophoneNamespace.handleError( _errorCallback, e );
}
_rcontrol = null;
}*/

 

I have no idea how it was throwing a NullPointerException, but without that section the code works perfectly fine.