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
yllus
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook

Writing voice-enabled app, with only one obstacle...

[ Edited ]

Hi folks,

 

I've been eyeing the Media.Microphone.record() function for use in a new PlayBook app that would take voice input and execute various commands. For the speech-to-text piece, I'll be using Zypr or Google Voice to do the heavy number crunching.

 

So here's the obstacle: For input formats, Zypr supports WAV 8kHz, 16 bit mono, AMR-NB 12.2Kbps, GSM 6.10 iLBC. Google Voice only takes a 16bit, 16Khz mono audio stream encoded as either FLAC or Speex binary data. 

 

For the PlayBook, the documentation for record()  lists WAV 44kHz, 16 bit mono as the sole encoding format. So close, but yet so far! Is there any way I can get that down to 8kHz on the WebWorks platform?

Developer
yllus
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook

Re: Writing voice-enabled app, with only one obstacle...

Interesting - from this related topic, I began looking into blackberry.media.microphone, and perhaps I can alter WaveEncoder.as at \bbwp\ext\blackberry.media.microphone\src\Air\Microphone\src\org\bytearray\micrecorder\encoder\ to encode at 8kHz instead of 44kHz? Will post again with my test results.

Developer
ibarrera
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Writing voice-enabled app, with only one obstacle...

I need to add a Speech to Text module in my app, not only for commands but also for long audio files. Would you recommend me Zypr or Google Voice? Have you found or some samples about them? Thanks a lot in advance.
Developer
yllus
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook

Re: Writing voice-enabled app, with only one obstacle...

I'd definitely go with Zypr - especially as the WebWorks platform can't easily output audio in the format Google Voice needs. Nor is Google Voice an official API, so it might disappear at any minute.

 

In terms of samples, I hope to get back to finishing my sample WebWorks application for speech recognition using Zypr shortly. I've already done the needed modifications to to encode audio to blackberry.media.microphone extension, and now just have to solve a simple file upload issue to get Zypr fully functional. I'll post the proof of concept app here as an attachment and also on GitHub for others to learn from. :smileyhappy:

Developer
ibarrera
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Writing voice-enabled app, with only one obstacle...

[ Edited ]

Actually I am doing a widget application for a smartphone, and i already used some javascript extension, so I could try to make one more extension to output audio in the format Google Voice needs, but afterwards I don't know how to continue and use google voice to transcript this audio file, I don't see any examples or something to guide me.

About Zypr, if i understood right, you have to upload the file to a site and then use Zypr, haven't you? Then it looks like Google Voice would be an easier solution.

And thanks a lot for sharing you knowledge with us. Now I am suscribed to this thread to keep myself updated...  :smileywink:


Developer
yllus
Posts: 57
Registered: ‎06-15-2011
My Device: PlayBook

Re: Writing voice-enabled app, with only one obstacle...

This blog post should give you the basics of what you need to use the Google Voice API. Be impressive if you wrote a FLAC converter!