Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Voice Record on Mobile Web Application

Question:
Is it possible, with some sort of technology, to integrate voice recording into a mobile web application?

Some background:
I have been working on a mobile web application just for my own enjoyment and research. Everything seemed to be working pretty slick with HTML5/CSS and JavaScript for the client application, although it looks like I need a third party technology for voice recording. I had a pretty good solution working with Flash, but after testing it with my IPhone, I had remembered that they don't seem to support flash which is disappointing because I had a pretty good solution going.

Voice Recording Requirements:
1. Must work with both iOS and Android.
2. Must work in most current versions of Firefox, Google Chrome, Internet Explorer, Opera, and Safari.
3. Must work within the framework of a mobile web application.
4. Must be able to record without being actively connected to the internet.
5. The client application shouldn't require the user to alter their phone OS.

I tried to be as specific as possible to assist in allowing you to answer this question accurately. If anything is unclear, just let me know in a comment below, and I will further clarify.

like image 367
dkroy Avatar asked Feb 21 '12 02:02

dkroy


People also ask

How do I record audio from a website on my phone?

Swipe down from the top of your screen to see the quick settings tiles and tap the screen recorder button. A floating bubble will appear with a record and microphone button. If the latter is crossed out, you're recording internal audio, and if it's not, you get sound straight from your phone's mic.

How do I record audio from a website on Android?

Go to Audio source and select Internal audio. You can use a third-party screen recorder app from the Google Play Store if your phone doesn't have one built-in. Using the AZ Screen Recorder as an example, go to the app settings, enable Record audio, tap on Audio source, and select Internal audio.


2 Answers

Check this http://www.html5rocks.com/en/tutorials/getusermedia/intro/

HTML Media Capture <input type="file">

Work for most of the mobile browsers, but it works not well because it will require native recording app and needs to active manually.

getUserMedia() and WebRTC

So far, only the Chromium support it well in mobile.

So, I gave up the web app. Hybrid app is the solution.

If you want to try the hybrid app for recording, you can check the Cordova Plugin https://github.com/emj365/cordova-plugin-audio-recorder-api that I created for recording task in the hybrid app.

like image 100
emj365 Avatar answered Oct 08 '22 20:10

emj365


It looks like in the years since asking this question a solution has surfaced. This solution has come in the form of MediaStreamConstraints dictionary audio property.

The Web API docs from Mozilla have a very nice example shown below:

document.getElementById("startButton").addEventListener("click", function() {
  navigator.mediaDevices.getUserMedia({
    audio: true
  }).then(stream => audioElement.srcObject = stream)
    .catch(err => log(err.name + ": " + err.message));
}, false);

Resources

  • https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints/audio
like image 28
dkroy Avatar answered Oct 08 '22 19:10

dkroy