private void InitialiseText() { _textIn = new TywiTextStream(new MemoryStream()); _session.RegisterInputText(_textIn); _textOut = new TywiTextStream(new MemoryStream()); _textOut.TextUpdated += this.UpdateTicker; _session.RegisterOutputText(_textOut); }
/// <summary> /// /// </summary> /// <param name="index"></param> /// <param name="stream"></param> /// <param name="device"></param> private void HandleOutputText(int index, TywiTextStream stream, DeviceProfile device) { TranscriptionModel transcriptions = _service.GetText(device); foreach (var line in transcriptions.transcriptions) stream.WriteText(line.text); }
public void RegisterOutputText(TywiTextStream stream) { _outputText = stream; }
/// <summary> /// /// </summary> /// <param name="index"></param> /// <param name="stream"></param> /// <param name="device"></param> private void HandleInputText(int index, TywiTextStream stream, DeviceProfile device) { string text = stream.ReadText(); if (text != null) { TextBlobModel textBlob = new TextBlobModel() { receivedTime = DateTime.Now, text = text }; _service.PostText(textBlob, device); } }
public void RegisterInputText(TywiTextStream stream) { _inputText = stream; }