WebAudioTrack icon indicating copy to clipboard operation
WebAudioTrack copied to clipboard

Recording does not work on Chrome M71

Open Jaikant opened this issue 6 years ago • 1 comments
trafficstars

New Autoplay policy, prevents recording as AudioContext goes to suspended state.

Jaikant avatar Jan 30 '19 12:01 Jaikant

I can confirm this is an issue, and that @Jaikant's proposed fix does indeed solve the problem.

I am not much of a JavaScript expert but I believe that audioContext.resume() is an asynchronous function and should be called like this:

this.context.resume().then(function() {
  /* proceed */
});  

It might also be good to check the state of the audioContext prior to resuming it, like this:

if (this.context.state === 'suspended') {
  this.context.resume().then(function() {
    /* proceed */
  });  
}

However, I have spent some time trying to implement that in WebAudioTrack and haven't had any luck. So, I am just going to implement the change as @Jaikant submitted it, as that seems to be working in 100% of cases for me.

axis80 avatar Mar 31 '19 04:03 axis80