addListener method

void addListener(
  1. VaisSpeechCallback listener, {
  2. bool singleUtterance = true,
  3. String modelParam = 'general',
})

Call this function before starting to get the duration, speechText and onConnection in realtime when playing Optional singleUtterance (default is true)

Implementation

void addListener(VaisSpeechCallback listener, {bool singleUtterance = true,String modelParam = 'general'}) {
  _listener = listener;
  if(singleUtterance==null){
    singleUtterance=true;
  }
  _singleUtterance = singleUtterance;
  _modelParam = modelParam;
  if (_streamingController != null) {
    _streamingController!.requestBeforeStartAudioRecord(singleUtterance, listener,modelParam);
  }
}