Question

Im developing an application (with phonegap) where I want the user to be able to record his/her voice, when pushing/holding a button. So far, I have only figured out one way to do this, by using phongap's capture audio method. When I click on the button, the device's audio recording application is launched.

So my question, is it possible to record an audio within the application by simply holding down a button, without launching the device's recording application?

<button id="record" d  class="btn btn-xlarge"> Record </button> 
 $("#record").mousedown(function(){
        // Start the recording, maximum 10 seconds save the audio file 
 });
 $("#record").mouseup(function(){
        // stop the recording and save the audio file 
 });
Was it helpful?

Solution

Instead of using the Catpure object, you may use the Media object: http://docs.phonegap.com/en/3.2.0/cordova_media_media.md.html#Media

This object makes it possible to interface the mic directly, without launching the device's audio recording application.

Some examples are found here: http://docs.phonegap.com/en/3.2.0/cordova_media_media.md.html#media.startRecord_quick_example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top