我有这个 Javascript 代码,当用户点击麦克风按钮时,我用它来捕获用户的音频输入。此代码适用于 Mozila Firefox,但当我在 Google Chrome 中使用它时,它不起作用并在控制台中显示此警告/错误 -The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
var r = function() {
var e = {}
, t = void 0
, n = getBotConfig()
, r = new Audio("data:audio/wav;base64,")
, o = !1;
if (!n.isIE()) {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var i = new AudioContext;
e.toggleRecording = function(e, t, n, r, s, a, c) {
e.classList.contains("recording") …Run Code Online (Sandbox Code Playgroud)