Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [UI] Add voice dialog #2285

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GiviMAD
Copy link
Member

@GiviMAD GiviMAD commented Jan 26, 2024

This is a WIP PR for the issue #2275

The PR uses these audio WebSocket which is still in review openhab/openhab-core#4032 so you need to use the org.openhab.core.io.websocket and org.openhab.core.voice bundles from there if you want to test it.

It is built on top of the webpack 5 upgrade PR #2267, because on webpack 4 you need to use loaders and I didn't want to generate more work to do in a future upgrade. The actual PR changes are in the last commit.

Changes added:

Screenshot 2024-01-26 at 17 12 13

I have added that panel at the end of the "help & about" page (it should only be displayed if the necessary APIs are available), it contains the following options:

  • "Enable Voice Dialog": When enabled the dialog execution will start after the first user event on the page (needed to start the microphone stream).
  • "Connection ID": And auto generated code that is used to register the audio components. Ex: the id of the registered sink will look like "pcm::ui-52-68::sink".
  • "Selected Keyword": Rustpotter config, choose rustpotter model file. At the moment the file is selected using an input type file and persisted using an IndexedDB instance.
  • "Keyword Threshold": Rustpotter config, threshold in range 0 - 1.
  • "Keyword Min Detections": Rustpotter config, min number of positive scores to emit the detection.
  • "Listening Item": Dialog configuration, Item to toggle while listening the command.
  • "Location Item": Dialog configuration, used by the Standard language processor to improve the Item selection.

Modifying any of the options triggers a page reload.

The dialog will use the voice services configured at "Settings / Voice". Once the dialog is running it can be triggered using the voice if the rustpotter model was provided, or using the listenAndAnswer action. For example from the oh console by running voice listenandanswer --source pcm::ui-52-68::source --sink pcm::ui-52-68::sink.

For now I have placed some console warning in the events emitted about the dialog state.

I wanted to open the PR in case you can give me some feedback about the integration of the feature or in case someone wants to dig into the implementation.

Best regards.

@GiviMAD GiviMAD requested a review from a team as a code owner January 26, 2024 17:49
Signed-off-by: Miguel Álvarez <[email protected]>
Copy link

relativeci bot commented Jan 31, 2024

Job #1392: Bundle Size — 11.86MiB (+7.89%).

355c5fc(current) vs 1c03c60 main#1391(baseline)

Warning

Bundle contains 19 duplicate packages – View duplicate packages

Warning

Bundle introduced 4 new packages: reentrant-lock, rustpotter-worklet, rustpotter-web-slim and one more – View changed packages

Bundle metrics  Change 8 changes Regression 4 regressions
                 Current
Job #1392
     Baseline
Job #1391
Regression  Initial JS 1.84MiB(+0.11%) 1.84MiB
No change  Initial CSS 607.73KiB 607.73KiB
Change  Cache Invalidation 22.37% 95.87%
Change  Chunks 223(+1.36%) 220
Change  Assets 250(+3.31%) 242
Change  Modules 3098(+0.78%) 3074
Regression  Duplicate Modules 162(+1.89%) 159
Regression  Duplicate Code 1.82%(+4.6%) 1.74%
Regression  Packages 154(+2.67%) 150
No change  Duplicate Packages 18 18
Bundle size by type  Change 3 changes Regression 3 regressions
                 Current
Job #1392
     Baseline
Job #1391
Regression  JS 9.33MiB (+1.54%) 9.19MiB
Regression  CSS 888.93KiB (~+0.01%) 888.86KiB
Regression  Other 744.53KiB (+87431.8%) 871B
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.24KiB 1.24KiB

View job #1392 reportView GiviMAD:feature/voice_dialog branch activityView project dashboard

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI awaiting other PR Depends on another PR labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting other PR Depends on another PR enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants