huangxiaojing 4 years ago
parent
commit
a12cffa875
1 changed files with 6 additions and 6 deletions
  1. 6 6
      screenIos/pcm-player.js

+ 6 - 6
screenIos/pcm-player.js

@@ -42,12 +42,12 @@ PCMPlayer.prototype.getTypedArray = function () {
 
 
 PCMPlayer.prototype.createContext = function () {
 PCMPlayer.prototype.createContext = function () {
     this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
     this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
-    console.log(this.audioCtx);
-    if (this.audioCtx.state === 'suspended' && 'ontouchstart' in window) {
-        var unlock = () => { this.audioCtx.resume(); };
-        document.body.addEventListener('touchstart', unlock, false);
-    }
-    this.gainNode = this.audioCtx.createGain();
+    // console.log(this.audioCtx);
+    // if (this.audioCtx.state === 'suspended' && 'ontouchstart' in window) {
+    //     var unlock = () => { this.audioCtx.resume(); };
+    //     document.body.addEventListener('touchstart', unlock, false);
+    // }
+    // this.gainNode = this.audioCtx.createGain();
     this.gainNode.gain.value = 1;
     this.gainNode.gain.value = 1;
     this.gainNode.connect(this.audioCtx.destination);
     this.gainNode.connect(this.audioCtx.destination);
     this.startTime = this.audioCtx.currentTime;
     this.startTime = this.audioCtx.currentTime;