小程序每次播放到第21回时出现内存泄漏提示 [这可让我说什么才好。]

一个汉字发音小程序,每次播放到第21个字时,在开发者工具上会有如下提示(在真机上运行会比较卡顿):

[Event] 21 listeners of event 15484096367270.5245944830972495_onAudioStateChange_play have been added, possibly causing memory leak.


主要代码如下


 const n = wx.createInnerAudioContext();

....

    voice2: function() {


        if (this.hasShowSound && this.data.hasEnded){


this.playSoundQues(); 

}else if(this.data.hasEnded && this.hasShowSound == !1){

this.showMo();

}else{


this.voiceStop();

}

    },

voiceStop: function() {

        n.stop();

    },

    playSoundQues: function() {

let that = this;

        let t = getApp(), a = this.data.answer, e = a.qa;


        //n.autoplay = !0,

         n.src = "https://tsn.baidu.com/text2audio?tex=" + encodeURI(e) + "***此处省略***" + t.globalData.token + "&per=0&spd=5&pit=5&vol=5", n.play(),

        n.onPlay(function() {

that.setData({ hasEnded : !1 });

nextEnable = !1;

        }),n.onEnded(function() {

that.setData({ hasEnded : !0 });

nextEnable = !0;

        }), n.onStop(function() {

that.setData({ hasEnded : !0 });

nextEnable = !0;

        }),n.onError(function(t) {

            nextEnable = !0,

console.log("error1---",t.errMsg), console.log("errorcode==",t.errCode);


        });

    },


  • 麻烦提供下代码片段:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html, QQ那玩意就像泡女朋友,等星星,等月亮,然后就有太阳了
    • https://developers.weixin.qq.com/s/EqOitGmw7v5A, 聊天软件而已。
    • 返回的文件的格式是什么呢?是连续点击21次就报错还是闪退?, 这么专业的问题,我还不会。
    • 调用百度的免费语音接口,返回的格式你可以打印出来看,要连续点击21次,不闪退, 不闪退而是根本就进不去