You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Currently, the livespeechtotext package provides recognized speech segments via the success event listener, but there is no built-in mechanism to distinguish between interim and final transcriptions. This makes it challenging to determine when the transcription process is complete, especially for integrating with text input fields where precise control over text updates is crucial.
Proposed Solution:
Introduce a "final text" indicator within the success event or a separate event to signify that the transcription is complete. This could be an additional property in the event payload that developers can check to know when the final recognized text is provided.
Example:
_livespeechtotextPlugin.addEventListener("success", (value) {
if (value.runtimeType != Map<String, dynamic>) return;
if ((value as Map<String, dynamic>).isEmpty) return;
if (transcribedText.isNotEmpty) {
if (isFinal) {
// Handle final recognized text
widget.onFinalTextRecognized(transcribedText);
} else {
// Handle interim text updates
widget.onInterimTextRecognized(transcribedText);
}
}
});
Benefits:
Clear differentiation between interim and final transcriptions.
Improved control over text input updates, reducing potential issues with text insertion.
Enhanced developer experience with more granular control over speech-to-text integration.
Use Case:
This feature is especially useful for applications that need to insert speech-to-text input at specific cursor positions within text fields, ensuring that only the final recognized text is inserted, avoiding redundant or partial updates.
Thank you for considering this feature request. It would greatly enhance the usability and functionality of the livespeechtotext package.
The text was updated successfully, but these errors were encountered:
Description:
Currently, the livespeechtotext package provides recognized speech segments via the success event listener, but there is no built-in mechanism to distinguish between interim and final transcriptions. This makes it challenging to determine when the transcription process is complete, especially for integrating with text input fields where precise control over text updates is crucial.
Proposed Solution:
Introduce a "final text" indicator within the success event or a separate event to signify that the transcription is complete. This could be an additional property in the event payload that developers can check to know when the final recognized text is provided.
Example:
_livespeechtotextPlugin.addEventListener("success", (value) {
if (value.runtimeType != Map<String, dynamic>) return;
if ((value as Map<String, dynamic>).isEmpty) return;
bool isFinal = value['isFinal'] ?? false;
String transcribedText = value['text'] ?? '';
if (transcribedText.isNotEmpty) {
if (isFinal) {
// Handle final recognized text
widget.onFinalTextRecognized(transcribedText);
} else {
// Handle interim text updates
widget.onInterimTextRecognized(transcribedText);
}
}
});
Benefits:
Clear differentiation between interim and final transcriptions.
Improved control over text input updates, reducing potential issues with text insertion.
Enhanced developer experience with more granular control over speech-to-text integration.
Use Case:
This feature is especially useful for applications that need to insert speech-to-text input at specific cursor positions within text fields, ensuring that only the final recognized text is inserted, avoiding redundant or partial updates.
Thank you for considering this feature request. It would greatly enhance the usability and functionality of the livespeechtotext package.
The text was updated successfully, but these errors were encountered: