1

We need to capture voice in a web portal. Our contractor developed the whole web portal without using Java Applications, only client-side code, and claims there is no way to capture voice using JavaScript today.

I'm not a Java guy, so I don't have the skills to discuss this, but I'll appreciate any help our folks here in SO can give: if you guys say it can not be done with today technology, so be it...

PS: the solution MUST attend IE, Chrome, Firefox and Safari, for end users, so Canary is out of question for now.

tcbrazil
  • 1,315
  • 12
  • 25
  • 1
    Are you looking for Java or for Javascript? – Bergi Oct 25 '13 at 12:36
  • It's experimental still but there is [`navigator.getUserMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator.getUserMedia) (with browser prefixes), which lets you access a connected webcam, microphone or both through _JavaScript_. – Paul S. Oct 25 '13 at 12:36
  • 1
    possible duplicate of [HTML5 record audio to file](http://stackoverflow.com/questions/16413063/html5-record-audio-to-file) – Paul S. Oct 25 '13 at 12:39
  • 1
  • 1
    this very much depends on what browsers are you targeting - as @PaulS. pointed out, you can get an experimental functionality to work on the very latest bleeding-edge browsers but this is unstable and likely to change in the future... so yes, there is no *reliable* way to do it via JavaScript just yet – Zathrus Writer Oct 25 '13 at 12:40
  • Try this http://www.sajithmr.me/jrecorder-jquery – LHH Oct 25 '13 at 12:47
  • Thanks @Bergi: it must be javascript, that's why I use the proper tag in the question. – tcbrazil Oct 27 '13 at 12:56
  • @PaulS.: thank you for the experimental function tip and the possible duplicate advice, I edited the question to make clear we need a broader reach of browsers. – tcbrazil Oct 27 '13 at 13:00
  • @tcbrazil: if it's JavaSript only, then that's more specific than "without Flash". See [using JavaScript to record in a web app](http://stackoverflow.com/questions/15082689/can-i-use-javascript-to-record-voice-on-a-web-app) – Dan Dascalescu Jun 29 '14 at 02:56
  • Dan Dascalescu, the solution you noted uses HTML5, that doesn't works in all browsers. And I believe it must be "without Flash", since JavaScript and Flash are not mutually exclusive... – tcbrazil Jun 30 '14 at 14:21

2 Answers2

1

The javascript's getUserMedia (getUserMedia on MDN) is a simple way to do this. I suggest you addyosmani's polyfill that has a flash fallback in case the browser doesn't yet support it.

Antonio E.
  • 4,381
  • 2
  • 25
  • 35
1

Currently there's no way reliable way to record audio using only HTML5 and JavaScript across browsers.

The only cross browser solution for non Flash recording on desktop browsers in the foreseeable future is the Media Recorder API. It's a recent standard proposal for a JS API who's purpose is to make audio and video recording in the browser very simple. Today it works only in Firefox 27 and only for audio. This article covers the standard in more detail.

If audio recording is important for you today I recommend you check out proven flash solutions like FLVAR or Audior. They work on all browsers, they are reliable and supported. Flash just works and major sites like YouTube and Netflix continue to use it.

octavn
  • 3,154
  • 32
  • 49
  • Tks Octavian, but since both FLVAR and Audior are Flash apps, I don't think they'll work on Safari. – tcbrazil Apr 19 '14 at 00:41
  • Safari on Mac OSX supports Flash Player and the browser is supported by both Audio and FLVAR. – octavn May 07 '14 at 13:21