Replies: 2 comments 5 replies
-
Hi @stevencmh could you share a code snippet so I can understand how you are using the library? Do you mean that if the user says the specific word multiple times, you only want to run the function on the first time they say it? If that's the case, you could store a boolean to decide if the function does anything and flip it the first time the function is called. Something like:
Or if you want to call the function multiple times, but only once for each time the word is spoken, you could also try focusing on changes to
Alternatively, you could also try making use of commands, especially if you aren't using continuous listening. If you're still stuck, share some code and I'll see what I can do to help. Your use case seems totally reasonable, so I'm keen to make sure it's supported. |
Beta Was this translation helpful? Give feedback.
-
Hi @JamesBrill thanks for posting back! I'd like to call a function once if there is a matching word in the transcript using the code below, but it ends up firing multiple times. Would I use commands to achieve this?
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I'd like to run a function if the transcript includes a specific word however when I console.log, or run a function, it runs multiple times.
Is there a way to make the function fire just once?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions