Merge pull request #198 from pangeachat/speech-to-text-fixes
fix for speech to text matrix event
This commit is contained in:
commit
0dc8473669
3 changed files with 17 additions and 14 deletions
|
|
@ -74,18 +74,21 @@ class SpeechToTextController {
|
|||
}
|
||||
debugPrint('Saving transcript as matrix event');
|
||||
|
||||
requestModel.audioEvent?.room.sendPangeaEvent(
|
||||
content: PangeaRepresentation(
|
||||
langCode: response.langCode,
|
||||
text: response.transcript.text,
|
||||
originalSent: false,
|
||||
originalWritten: false,
|
||||
speechToText: response,
|
||||
).toJson(),
|
||||
parentEventId: requestModel.audioEvent!.eventId,
|
||||
type: PangeaEventTypes.representation,
|
||||
);
|
||||
debugPrint('Transcript saved as matrix event');
|
||||
requestModel.audioEvent?.room
|
||||
.sendPangeaEvent(
|
||||
content: PangeaRepresentation(
|
||||
langCode: response.langCode,
|
||||
text: response.transcript.text,
|
||||
originalSent: false,
|
||||
originalWritten: false,
|
||||
speechToText: response,
|
||||
).toJson(),
|
||||
parentEventId: requestModel.audioEvent!.eventId,
|
||||
type: PangeaEventTypes.representation,
|
||||
)
|
||||
.then(
|
||||
(_) => debugPrint('Transcript saved as matrix event'),
|
||||
);
|
||||
|
||||
return Future.value(null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class PangeaToken {
|
|||
static const String _lemmaKey = ModelKey.lemma;
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
_textKey: text,
|
||||
_textKey: text.toJson(),
|
||||
_hasInfoKey: hasInfo,
|
||||
_lemmaKey: lemmas.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class STTToken {
|
|||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"token": token,
|
||||
"token": token.toJson(),
|
||||
"start_time": startTime?.inMilliseconds,
|
||||
"end_time": endTime?.inMilliseconds,
|
||||
"confidence": confidence,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue