Capture audio phonegap 3.0 without interface

我们两清 提交于 2019-12-13 04:41:59

问题


I have gotten audio recording to work on Phonegap 3.0, however depending on the platform it launches a custom interface that facilitates the recording.

Is there a way to not show the interface but use a custom interface?


回答1:


Answer:

Instead of using the capture API, use the media api.

    function recordAudio() {
    var src = "myrecording.mp3";
    var mediaRec = new Media(src,
        // success callback
        function() {
            console.log("recordAudio():Audio Success");
        },

        // error callback
        function(err) {
            console.log("recordAudio():Audio Error: "+ err.code);
        });

    // Record audio
    mediaRec.startRecord();
}


来源:https://stackoverflow.com/questions/18542547/capture-audio-phonegap-3-0-without-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!