onTranscribingEvent method

void onTranscribingEvent(
  1. String speakerId,
  2. String text,
  3. String offset,
  4. String duration,
)

Implementation

void onTranscribingEvent(String speakerId,String text,String offset,String duration) {
  var date = DateTime.now();
  var startTime = int.parse(offset) ;
  var endTime = startTime + int.parse(duration) ;
  if(newText){
    currentSpeechStart = date.millisecondsSinceEpoch;
    newText = false;
  }
  if(!autoTranslate){
    azureSttCallback.onTranscribingEvent(speakerId,text,"",-1,false,startTime,endTime,date.millisecondsSinceEpoch);
  }
  else{
    transcribingChannelQueue.add(TranscribObject(text, speakerId,startTime,endTime));
  }
}