juliusjs
juliusjs copied to clipboard
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
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..
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);
});
and shown here, add a button to the HTML page that calls Julius, e.g.:
<button type="button">Click Me!</button>