src/components/virtualbodyapi.js
/**
   * Speaks text using the selected voice
   * @param text
   */
Speaks text using the selected voice
@param text
Speaks text using the selected voice @param text
speak(text) {
    let utter = new SpeechSynthesisUtterance();
    utter.rate = this.utter.rate;
    utter.pitch = this.utter.pitch;
    utter.voice = this.utter.voice;
    console.log('speak text:', text);
    utter.text = text;
    utter.onboundary = function(event) {
      if (event.name === 'sentence') console.log('onboundary catched:', event);
    };
    window.speechSynthesis.speak(utter);
  }
speak ( text ) { let utter = new SpeechSynthesisUtterance ( ) ; utter . rate = this . utter . rate ; utter . pitch = this . utter . pitch ; utter . voice = this . utter . voice ; console . log ( 'speak text:' , text ) ; utter . text = text ; utter . onboundary = function ( event ) { if ( event . name === 'sentence' ) console . log ( 'onboundary catched:' , event ) ; } ; window . speechSynthesis . speak ( utter ) ; }
Speaks text using the selected voice
 @param text
Speaks text using the selected voice @param text
//utter.onmark= function(event){ //      console.log("onmark catched:",event) //    } // this will hold a selected voice