3

I'm working on a C++ application which takes microphone input, processes it, and plays back some audio. The processing will incorporate a database located on a server. For ease of creating UI and for maximum portability, I'm thinking it would be nice to have the front end be done in HTML. Essentially, I want to record audio in a browser, send that audio to the server for processing, and then receive audio from the server which will then be played back inside the browser.

Obviously, it would be nice if HTML5 supported microphone input, but it does not. So, I will need to create a plugin of some kind in order to make this happen. NPAPI scares me because of the security issues involved, so I was looking into PPAPI and Native Client. Native Client does not yet support microphone input, and I believe that the PPAPI audio input API would be limited to a dev build of Chrome. FireBreath doesn't look like it supports any microphone function either. So, I believe my options are:

  • Write my own NPAPI plugin to record the audio
  • Use Flash to get microphone input
  • Bail on browsers altogether and just make a native application

The target audience for this is young children and people who aren't computer-adept. I'd like to make it as portable and simple to use as possible. Any suggestions?

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
erock2112
  • 139
  • 4
  • 10
  • As Georg noted, FireBreath is not and was never intended to be a framework that provides everything for you; it just makes it easier to create a NPAPI plugin/ActiveX control where you'd write all your microphone input code yourself using platform APIs. – taxilian Feb 11 '12 at 06:10
  • There's a Chromium bug that pretty much covers this: [http://code.google.com/p/chromium/issues/detail?id=112367](http://code.google.com/p/chromium/issues/detail?id=112367) There are also some (slightly out of date) examples here: [https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/webrtc-integration.html](https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/webrtc-integration.html) – Sam Dutton May 10 '12 at 17:45

2 Answers2

2

You can use Capturing Audio & Video features in HTML5, see this link for more information.

Saeed Zarinfam
  • 9,818
  • 7
  • 59
  • 72
2

If you can do it all in Flash and have the relevant knowledge, that would probably be the best solution:
You can avoid writing platform-specific code, delivery/updating is easy and Flash has broad coverage so users don't need to install any custom plugins.

FireBreath doesn't look like it supports any microphone function either.

You can write your own (platform-dependent) code for audio recording with FireBreath, just like you could in a plain NPAPI plugin. FireBreath just makes it easier for you to write the plugin, the result is still a NPAPI (and ActiveX) plugin with access to native APIs etc.

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
  • seconded; on every point. You should never write a plugin where something simpler will do; if you can do it with flash, which is most often already there, you'll be much better off. If you can't, FireBreath is an easier solution but will require understanding of platform APIs in C++. – taxilian Feb 11 '12 at 06:11
  • Great, thanks. I didn't want to write a plugin from scratch, but also had some reservations about learning Flash. – erock2112 Feb 11 '12 at 17:24