繁体   English   中英

无法在Windows(Phone)8.1上使用Cordova Media插件录制音频

[英]Cannot record audio with Cordova Media plugin on Windows (Phone) 8.1

我正在尝试创建一个允许用户录制音频的应用程序。 我正在为此使用cordova-plugin-media

使用文档中的示例,我可以在iOS(指定* .wav文件),Android(* .amr),Windows Phone 8(* .aac)上录制声音,但是Windows Phone 8.1无法正常工作。 我已经尝试过使用* .mp3,*。wma和* .m4a,但是在每种情况下,我都会遇到此错误:

找不到合适的变换来编码或解码内容。

这是代码的一部分:

var that = this;

try {
    this._media = new Media('recording.mp3', function () {
        that._log('Audio success');
    }, function (e) {
        that._log('Error: ' + e.code + ': ' + e.message);
    });

    // Bind buttons
    document.querySelector('#recordStart').addEventListener('click', function () {
        // Record
        that._log('Recording...');
        that._media.startRecord();
    });

    document.querySelector('#recordStop').addEventListener('click', function () {
        that._log('Recording stopped');
        that._media.stopRecord();
    });
}
catch (e) {
    this._log('An error occurred!');
    this._log(e.message);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM