fix(speech to text): speech to text now working. Also fixed overflow caused by tooltop message
This commit is contained in:
parent
19a21155bc
commit
41ada11b53
2 changed files with 40 additions and 45 deletions
|
|
@ -148,7 +148,7 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
|
|||
|
||||
Future<void> _setInitialToolbarMode() async {
|
||||
if (pangeaMessageEvent?.isAudioMessage ?? false) {
|
||||
updateToolbarMode(MessageMode.messageTextToSpeech);
|
||||
updateToolbarMode(MessageMode.messageSpeechToText);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,51 +176,46 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
}
|
||||
|
||||
//TODO: find better icons
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
RichText(
|
||||
text: transcriptText!,
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: AppConfig.toolbarMinWidth,
|
||||
maxHeight: AppConfig.toolbarMaxHeight,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
RichText(
|
||||
text: transcriptText!,
|
||||
),
|
||||
if (widget.messageEvent.senderId ==
|
||||
Matrix.of(context).client.userID)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconNumberWidget(
|
||||
icon: Icons.speed,
|
||||
number: wordsPerMinuteString != null
|
||||
? "$wordsPerMinuteString"
|
||||
: "??",
|
||||
toolTip: L10n.of(context).wordsPerMinute,
|
||||
),
|
||||
],
|
||||
),
|
||||
const InstructionsInlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.speechToText,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
if (widget.messageEvent.senderId == Matrix.of(context).client.userID)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// IconNumberWidget(
|
||||
// icon: Symbols.target,
|
||||
// number:
|
||||
// "${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
|
||||
// toolTip: L10n.of(context).accuracy,
|
||||
// ),
|
||||
// const SizedBox(width: 16),
|
||||
IconNumberWidget(
|
||||
icon: Icons.speed,
|
||||
number: wordsPerMinuteString != null
|
||||
? "$wordsPerMinuteString"
|
||||
: "??",
|
||||
toolTip: L10n.of(context).wordsPerMinute,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: InstructionsInlineTooltip(
|
||||
instructionsEnum: InstructionsEnum.speechToText,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue