https://github.com/manolo/addon-voice-engine
A Vaadin Addon that allows usage of SpeechRecognition and SpeechSynthesis JS API
https://github.com/manolo/addon-voice-engine
Last synced: 6 months ago
JSON representation
A Vaadin Addon that allows usage of SpeechRecognition and SpeechSynthesis JS API
- Host: GitHub
- URL: https://github.com/manolo/addon-voice-engine
- Owner: manolo
- License: other
- Created: 2024-11-04T11:50:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-15T16:24:11.000Z (over 1 year ago)
- Last Synced: 2025-04-11T17:51:13.163Z (over 1 year ago)
- Language: Java
- Size: 146 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Voice Addon
An addon for voice recognition and speach text
## Example
```java
@Route("")
public class VoiceEngineView extends Div {
public VoiceEngineView() {
setSizeFull();
Button clearButton = new Button(LumoIcon.CROSS.create());
VoiceEngine voiceEngine = new VoiceEngine().setButtons(MICROPHONE, PLAY, LANG, VOICE);
voiceEngine.add(clearButton);
TextArea textArea = new TextArea();
textArea.setSizeFull();
add(new VerticalLayout(voiceEngine, textArea));
clearButton.addClickListener(e -> textArea.clear());
voiceEngine.addStartListener(e -> textArea.clear());
textArea.addValueChangeListener(e -> voiceEngine.setSpeech(e.getValue()));
voiceEngine.addEndListener(e -> {
if (voiceEngine.getRecorded() != null) {
textArea.setValue(voiceEngine.getRecorded());
}
if (!textArea.getValue().isEmpty()) {
voiceEngine.setSpeech(voiceEngine.getRecorded());
}
});
}
}
```