|
|
|
|
@ -88,7 +88,7 @@ class PangeaMessageEvent {
|
|
|
|
|
return _latestEdit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<PangeaAudioFile?> getMatrixAudioFile(
|
|
|
|
|
Future<PangeaAudioFile> getMatrixAudioFile(
|
|
|
|
|
String langCode,
|
|
|
|
|
BuildContext context,
|
|
|
|
|
) async {
|
|
|
|
|
@ -102,15 +102,11 @@ class PangeaMessageEvent {
|
|
|
|
|
langCode: langCode,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
final TextToSpeechResponse? response =
|
|
|
|
|
final TextToSpeechResponse response =
|
|
|
|
|
await MatrixState.pangeaController.textToSpeech.get(
|
|
|
|
|
params,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final audioBytes = base64.decode(response.audioContent);
|
|
|
|
|
final eventIdParam = _event.eventId;
|
|
|
|
|
final fileName =
|
|
|
|
|
@ -181,13 +177,10 @@ class PangeaMessageEvent {
|
|
|
|
|
langCode: langCode,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
final TextToSpeechResponse? response =
|
|
|
|
|
final TextToSpeechResponse response =
|
|
|
|
|
await MatrixState.pangeaController.textToSpeech.get(
|
|
|
|
|
params,
|
|
|
|
|
);
|
|
|
|
|
if (response == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final audioBytes = base64.decode(response.audioContent);
|
|
|
|
|
|
|
|
|
|
@ -330,7 +323,7 @@ class PangeaMessageEvent {
|
|
|
|
|
debugPrint("mimeType ${matrixFile.mimeType}");
|
|
|
|
|
debugPrint("encoding ${mimeTypeToAudioEncoding(matrixFile.mimeType)}");
|
|
|
|
|
|
|
|
|
|
final SpeechToTextModel? response =
|
|
|
|
|
final SpeechToTextModel response =
|
|
|
|
|
await MatrixState.pangeaController.speechToText.get(
|
|
|
|
|
SpeechToTextRequestModel(
|
|
|
|
|
audioContent: matrixFile.bytes,
|
|
|
|
|
@ -346,10 +339,6 @@ class PangeaMessageEvent {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (response == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_representations?.add(
|
|
|
|
|
RepresentationEvent(
|
|
|
|
|
timeline: timeline,
|
|
|
|
|
|