Closed LuizLeite closed 5 years ago
Checking into this.
Making updates and will post them!
Almost done...
Added support for modules.
<script type="module">
import spoken from './node_modules/spoken/build/spoken.js';
spoken.say('Should I turn the hallway light on?').then( speech => {
spoken.listen().then( transcript =>
console.log("Answer: " + transcript) )
} )
</script>
Tanks. I will try it. Luiz Leite
Em sexta-feira, 3 de agosto de 2018 18:20:54 BRT, Stephen L. Blum <notifications@github.com> escreveu:
Added support for modules.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Sweet!
Hi. More one question. How to choose a voice to speek? There are two pt-BR in list of voices. Tank you again. Luiz Leite
Em sexta-feira, 3 de agosto de 2018 19:26:03 BRT, Stephen L. Blum <notifications@github.com> escreveu:
Sweet!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
By default 'pt-BR' was selected automatically for you spoken.recognition.language = navigator.language;
.
You can get a list of voices using the following example:
// Set native voice language
spoken.recognition.language = 'en-US';
// Get a List of Voices with promise callback
spoken.voices().then( voices => console.log(voices) );
Here is a full example:
(async function() {
// List of English Speaking Voices
spoken.recognition.language = navigator.language || 'en-US';
let voices = (await spoken.voices()).filter( v => !v.lang.indexOf('en') );
// Use the First Voice
spoken.say( 'Welcome to flavor town.', voices[0] );
})()
Hi.
How to use with: "import spoken from 'spoken'?
Can you given a example with Webpack?
Tanks.