未捕获的DOMException:无法构造"AudioContext":提供的硬件上下文的数量(6) [英] Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6)

查看:705
本文介绍了未捕获的DOMException:无法构造"AudioContext":提供的硬件上下文的数量(6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试实现Microsoft Bing语音api及其前5次正常工作,此后,当我录制自己的声音时,控制台出现异常. 异常:未捕获的DOMException:无法构造"AudioContext":提供的硬件上下文的数量(6)大于或等于最大限制(6).

i am trying to implement microsoft bing speech api and its working fine for the first 5 times after that when i record my voice i getting exception in console . Exception : Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6).

当我尝试使用AudioContext.close()关闭时,它显示另一个错误,例如未捕获(承诺)DOMException:无法关闭正在关闭或已经关闭的上下文". 谁知道这是什么错误.我正在使用Microsoft bing语音的语音1.0.0 js sdk.

when i try to close with AudioContext.close() it shows another error like "Uncaught (in promise) DOMException: Cannot close a context that is being closed or has already been closed." Anybody know whats the error is this . i am using speech 1.0.0 js sdk of microsoft bing speech .

推荐答案

我有解决此问题的解决方案,我只是在录音停止时关闭了音频上下文,并且对我来说很好用:)

I have a solution to resolve this problem, i just closed the audio context when the recording stops and its working fine for me :)

这是经过编辑的speech.js停止方法:`

here is the edited speech.js stop method :`

Speech.prototype.stop = function () {
        if (this._currentSource) {
            // context will be closed here
            this.context.close(); // new added code for the continues context creation (To avoid DoM exception)


    };`

这篇关于未捕获的DOMException:无法构造"AudioContext":提供的硬件上下文的数量(6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆