Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. #27

Open
TrRavi opened this issue Mar 25, 2019 · 2 comments

Comments

@TrRavi
Copy link

TrRavi commented Mar 25, 2019

During the page loading ,
in chrome console it is showing

julius.js:22 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

problem is here

var initializeAudio = function(audio) {
audio.context = new (window.AudioContext || window.webkitAudioContext)();
audio.processor = audio.context.createScriptProcessor(4096, 1, 1);
};

Please somebody tell me how to solve this..

@kendmaclean
Copy link

as described here update your dist/julius.js as follows:

//      initializeAudio(this.audio);
//      bootstrap.call(this, pathToDfa, pathToDict, options);
document.querySelector('button').addEventListener('click', function() { 
      initializeAudio(that.audio);
      bootstrap.call(that, pathToDfa, pathToDict, options);
});

@kendmaclean
Copy link

and shown here, add a button to the HTML page that calls Julius, e.g.:

<button type="button">Click Me!</button>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants