Voice Recognition
Enables voice recording using the Web Speech API, displaying transcribed text, and offering controls for starting/stopping, clearing speech, and aborting recording.
The component allows users to record their voice using the Web Speech API and displays the transcribed speech as text. The component provides buttons for starting/stopping recording, clearing the speech, and aborting the recording.
Sample code
// Create a new VoiceRecognition instance VoiceRecognition voiceRecognition = new VoiceRecognition(); // Create a new Div for displaying the speech recognition results Div resultLayout = new Div(); // Add the VoiceRecognition component and a Label for the results to the layout add(voiceRecognition, new Label("Result:"), resultLayout); // Add a result listener to the VoiceRecognition component voiceRecognition.addResultListener(listener -> { // Update the resultLayout's text with the speech recognized by the component resultLayout.setText(listener.getSpeech()); });
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Release Notes Version 1.0.2 In this release, we have introduced new features and enhancements to the VoiceRecognition component. The following changes have been made:
Added Documentation: Comprehensive documentation has been added to the VoiceRecognition Java class, making it easier for users to understand and use the component effectively. This includes descriptions for the class itself, its properties, methods, and events. The detailed documentation will guide users on how to interact with the component and its events.
Added the Ability to Use Internal Buttons: The VoiceRecognition component now supports the option to use or hide its internal buttons. By using the setUseInternalButtons method, developers can control the visibility of the internal buttons for starting, stopping, and aborting the speech recognition process. This feature provides more flexibility for users to customize the component's appearance and behavior according to their requirements.
These updates are aimed at improving the user expe
- Released
- 2023-04-05
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 20+
- Browser
- Firefox
- Opera
- Safari
- Google Chrome
- iOS Browser
- Android Browser
- Microsoft Edge