How to start Speech Recognition with a trigger in this Storyline Speech Recognition Example ?

Sep 04, 2018

Thanks to Matthew Terentjev's great post here, it's possible for storyline users to create online Speech Recognition Interactions in their projects, now my question is how to initiate startButton function in HTML file named vars.html with Storyline triggers? ( in the vars.html file there is a code that when the user clicks on the microphone button, it triggers startButton function ) 

That way I can start the Speech Recognition using a trigger in storyline timeline whenever I want.

I attached the zip file here :

Any comment or idea is extemly appreciated.

14 Replies
Max Maxer

Hi dear Matthew, I tried to put all javascript to Storyline and execute it with a simple button but that doesn't work at all...

Then I tried to execute javascript at timeline start and trigger startButton function with a button but this is not working too... 

How Can I do that?

please help, I'm new to Storyline and java :(

Max Maxer

Yep, That works and it's great.

I Think Articulate Should Be Happy And Of course Thankful To Have Such a Genius And CREATIVE Users Like you.

Thank you for your kind help, 

The code you provided is simple and clean and that's what confuses me more, I tried to do some modifications and two of them make me feel like I'm a big failure in life :( I know that maybe there is a way to solve them or maybe they are some bugs, Storyline Bugs! I Don't Know...

1) First one is even if you add the recognition.continuous = true; Recognition does not continue when the user pauses while speaking. even when I change this part to :

recognition.onspeechend = function() {
console.log('Speech ended!');

2) I tried to do something just like your first project, each time user clicks to start a new recognition, the last recognized text disappears, (Not when the user starts speaking but when he/she clicks the button). in last 24 hours, I was trying to find a solution for this with no success.





I am trying to figure out how to build a course where the learner would speak into the microphone to learn malay. I am hoping i can trigger the javascript from within storyline itself without having to host the var.html file. The links to the blogpost does not work and I am unable to follow. Any advice on what is the javascript to use within storyline for speech to text? 

Nancy Arsenault

I've been trying this but I keep getting stuck. Currently trying to review in Review 360 but I'm getting an error as follows in the console log:

"Error occurred in recognition: not-allowed"

In other pages I notice that a microphone permission pop-up appears, but I'm not seeing that happen, so I wonder if anything has changed since this solution was posted that would prevent Review 360 from properly executing the JavaScript