Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Js warning in Chrome: AudioContext is not allowed to start #7

Open

Description

@idreamin

image

thank you very much !

Activity

  1. cain06 commented on Sep 13, 2019

    @cain06

    Anyone who is monitoring this, the solution to this is pretty easy, in the example there is a line like this:

    const audioContext = new (window.AudioContext || window.webkitAudioContext)();

    Really what you want to do is create the audioContext in your click handler, not as a const. E.g.

    
    var audioContext = null;
    $(".record").click(function() {
      if (audioContext == null) {
          audioContext =  new (window.AudioContext || window.webkitAudioContext)();
      }
      // rest of example will work now
    });
    
  2. nvlong198 commented on Nov 5, 2019

    @nvlong198

    @cain06 @ijsnow
    from line 37 in example
    I created new audioContext like this:

    start = () => {
          this.audioContext =  new (window.AudioContext || window.webkitAudioContext)();
          this.recorder.start()
            .then(() => this.setState({isRecording: true}));
        }
    

    but It still warning in Chrome and I can not record anything.
    Firefox and edge work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions