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

Development #487

Merged
merged 5 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/shell-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
uses: actions/checkout@v1
- name: Run ShellCheck
uses: azohra/shell-linter@latest
with:
path: "*.sh"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ logs
certificates/*
!certificates/.gitkeep

# Ignore the contents of the "src/client/assets" directory
src/client/assets/*

# Ignore the contents of the "src/client/bundles" directory
src/client/bundles/*

Expand All @@ -152,6 +155,9 @@ src/client/config/*
# Ignore the contents of the "src/client/log" directory
src/client/log/*

# Ignore the contents of the "src/client/serial_communication" directory
src/client/serial_communication/*

# Ignore the contents of the "src/server/skills_db" directory except for the file
# named "open_the_web_browser.json".
src/server/skills_db/*
Expand Down
3 changes: 2 additions & 1 deletion .shellcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ shell=bash
# Enable specific checks (comma-separated)
# To disable a check, prefix it with "no"
#enable=SC1000,noSC2000
disable=SC1090,SC1091,SC1087
#disable=SC1090,SC1091,SC1087
disable=SC1090,SC1091,SC1087,SC2016,SC2154

# Ignore specific errors in certain lines
# Example: Ignore SC1000 and SC2000 in lines 5 and 10
Expand Down
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,9 @@ Commbase bundles two Whisper-based STT engines to choose from: commbase-stt-whis

Every Commbase STT engine has its advantages and disadvantages.

The proactive STT engine continuously changes among 4 strokes: listening, active, processing, and stopped, which makes it more suitable for talkative devices that do not stop capturing and processing sound in time, for example, specific droids and robots. Its learning curve is higher compared to the simplified use of a rec button for the reactive STT engine. The adaptability to a single recording countdown time rhythm ensures that the use experience is not only precise but also synchronized. This STT engine experience can be improved by hardware, for example: LED lightning, sounds, and other signals for the user.
The proactive STT engine continuously changes among 4 strokes: listening, active, processing, and stopped, which makes it more suitable for talkative devices that do not stop capturing and processing sound in time, for example, specific droids and robots. Its learning curve is higher compared to the simplified use of a rec button for the reactive STT engine. It has a customizable countdown timer to ensure that the engine takes pauses when the user is not using it, for saving system resources like power and GPU. This STT engine experience can be improved by hardware, for example: LED lightning, sounds, and other signals for the user. This mode is insecure by default, because anybody can tell your app voice commands, including commands to turn off Commbase, reload STT engines, change language, and so on, unless you disable or program critical options and skill to ask for user intervention to allow or deny them to run.

The reactive STT engine requires the Commbase application to be actively open in the foreground and in focus. There is a keybinding you can set up to be able to send requests to the application running in the background, unfocused, without using a keyboard key (the information is in the User's Guide, in the section "4 Set Up Microphones and Audio Keybindings"). There is also an alternative setup that involves configuring the recorder-transmitter script reccomm.sh on a remote host. It's worth noting that this host isn't confined to being a traditional computer; it can also be, for example, an Android smartphone or a Raspberry Pi equipped with Wi-Fi.
The reactive STT engine requires the Commbase application to be actively open in the foreground and in focus. There is a keybinding you can set up to be able to send requests to the application running in the background, unfocused, without using a keyboard key (the information is in the User's Guide, in the section "4 Set Up Microphones and Audio Keybindings"). There is also an alternative setup that involves configuring the recorder-transmitter script reccomm.sh on a remote host. It's worth noting that this host isn't confined to being a traditional computer; it can also be, for example, an Android smartphone or a Raspberry Pi equipped with Wi-Fi. This mode is secure by default, as users can select appropriate time windows to issue voice commands without disrupting Commbase's functionality with external noises or invalid commands spoken to the app by others within its active radius.

You will find more information about both STT engines in the User's Guide.

Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ This project is coded and organized like this:
│ ├── libcommbase
│ │ ├── routines
│ │ └── skills
│ │ ├── parsers
│ │ └── runners
│ │ └── skills_db
│ └── resources
│ ├── bundles
│ │ └── sounds
Expand Down Expand Up @@ -123,6 +122,9 @@ This project is coded and organized like this:
│ └── reset_commbase.conf
├── src # This directory contains user-generated source code
│ ├── client
│ │ ├── assets # Stores different types of assets, such as images, fonts, and ASCII art
│ │ │ ├── ascii
│ │ │ └── docs # Stores your app User's Guide
│ │ ├── bundles
│ │ │ ├── audiobooks
│ │ │ │ └── Robinson_Crusoe
Expand All @@ -134,7 +136,16 @@ This project is coded and organized like this:
│ │ │ └── openai_whisper_models
│ │ │ ├── base
│ │ │ └── ...
│ │ └── log
│ │ ├── log
│ │ └── serial_communication
│ │ ├── arduino
│ │ │ ├── arduino_0
│ │ │ │ ├── commbase_hardware_notifications
│ │ │ │ │ ├── speech_to_text_engine_component
│ │ │ │ │ └── ...
│ │ │ │ └── ...
│ │ │ └── ...
│ │ └── ...
│ ├── server
│ │ └── skills_db
│ │ ├── arduino
Expand Down
21 changes: 0 additions & 21 deletions assets/ascii/avatar.asc

This file was deleted.

73 changes: 66 additions & 7 deletions assets/docs/User's Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,12 @@ The default version of the file **commbase.conf** contains the next values:
- `bundles/commbase-recorder-transmitter-b/reccomm.sh` (Default): The route to the Bash version of the recorder-transmitter. The Bash script can be set up to run simultaneously as a remote recorder-transmitter despite this configuration.
- `bundles/commbase-recorder-transmitter-s/reccomm.sh`: The route to the Shell version of the recorder-transmitter. The Shell (POSIX) script can be set up to run simultaneously as a remote recorder-transmitter despite this configuration.

**CUSTOM_RECORDER_TRANSMITTER_FILE**:
- Description: It allows to replace the default recorder-transmitter chosen with the route to a new custom one. Other custom recorder-transmitter applications can be set up in a different path and executed remotely (for example, this app can be an Android or iPhone app for smartphones), but in those cases you do not need to provide any path to a custom transmitter executable file here.
- Possible values: Any route to a custom recorder-transmitter file.
- Example value:
-`bundles/commbase-recorder-transmitter-x/reccomm.sh` (Default): The path to a custom recorder-transmitter executable.

- **STT_ENGINE_MODEL_DIRECTORY**:
- Description: It specifies the path to the directory of the current STT engine's model in use. In order to facilitate internationalization, the directory resides in **bundles/libcommbase/resources/i18n/** and **src/client/i18n/**. Check out the variable `STT_ENGINE_MODEL_SUBDIRECTORY`.
- Possible values:
Expand All @@ -904,7 +910,7 @@ The default version of the file **commbase.conf** contains the next values:
- `large`: If set to this value, the STT engine uses the OpenAI Whisper model "large".

- **STT_ENGINE_PATH**:
- Description: It specifies the path to the current STT engine's executable or script file bundled with Commbase. It is updated to one of following possible values (TODO: create a skill command and a Keybinding for this.)
- Description: It specifies the path to the current STT engine's executable or script file bundled with Commbase. Just change this path to switch from one STT engine to another. The change can be perfectly done with a skill command and/or a keybinding.
- Possible values:
- `$COMMBASE_APP_DIR/bundles/commbase-stt-whisper-reactive-p/commbase_stt_whisper_reactive_p.py` (Default): Reactive means the engine is always lazily listening, processing the voice messages only when they arrive. Therefore, engine has 2 strokes: passive and processing.
- `$COMMBASE_APP_DIR/bundles/commbase-stt-whisper-proactive-p/commbase_stt_whisper_proactive_p.py`: Proactive means the engine continuously changes among 4 strokes: listening, active, processing, and stopped.
Expand All @@ -918,6 +924,11 @@ The default version of the file **commbase.conf** contains the next values:
- Possible values:
- `/bundles/commbase-stt-whisper-reactive-p/client_data/recording.wav` (Default): The Commbase STT Whisper reactive p client temporary audio recording file. The purpose of this file is for storing audio data obtained from the execution of the bash script **commrecorder.sh** in the directory **bundles/commbase-stt-whisper-reactive-p/**. **commbase_stt_whisper_reactive_p.py** monitors the modification time of this file and, upon detecting changes, transcribes the audio content using the Whisper ASR (Automatic Speech Recognition) model. The transcribed text is then printed and appended to the chatroom pane.

- **STT_ENGINE_PROCESSING_TIME_VISIBLE_ON**:
- Description: It specifies whether yes or not the running STT displays the speech processing time in the STT engine pane after every processing is complete.
- Possible values: True or False.
- Default value: `False` (Default): Set to false, the STT engine does not display the speech processing time in the STT engine pane after every processing is complete.

- **CHAT_LOG_FILE**:
- Possible values:
- `/data/.chat_log.txt` (Default): The chat log file likely stores a record of interactions or conversations.
Expand Down Expand Up @@ -1231,17 +1242,65 @@ The default version of the file **commbase.conf** contains the next values:
- Example value:
- `3600` (Default): Set to 3600 seconds (equivalent to 1 hour and 0 minutes), indicates that the system checks for pending tasks approximately every 60 minutes.

- **EXTERNAL_STORAGE_DRIVE_01_TAG**:
- **COMMBASE_HARDWARE_NOTIFICATIONS_ON**:
- Description: Indicates whether Commbase hardware notifications are enabled or disabled. If set to "True", hardware notifications are enabled; otherwise, they are disabled.
- Possible values: "True" or "False". Set to "True" only if you are making Commbase hardware, such as: hardware interfaces, a speech to text engine component, or any other hardware device based on Commbase (droids, smart appliances, vehicles, etc.) Check out the existent Commbase hardware variables.
- Example value:
- `False` (Default): Hardware notifications are disabled.

- **COMMBASE_HARDWARE_NOTIFICATION_LISTENING_START_ON**:
- Description: Indicates whether Commbase hardware notifications for the start of the STT engines listening process are enabled or disabled. Check out the other existent Commbase hardware variables.
- Possible values: "True" or "False".
- Example value:
- `True` (Default): Notifications for the start of the listening process are enabled.

- **COMMBASE_HARDWARE_NOTIFICATION_LISTENING_STOP_ON**:
- Description: Indicates whether Commbase hardware notifications for the stop of the STT engines listening process are enabled or disabled. Check out the other existent Commbase hardware variables.
- Possible values: "True" or "False".
- Example value:
- `True` (Default): Notifications for the stop of the listening process are enabled.

- **COMMBASE_HARDWARE_NOTIFICATION_PROCESSING_START_ON**:
- Description: Indicates whether Commbase hardware notifications for the start of the STT engines processing are enabled or disabled. Check out the other existent Commbase hardware variables.
- Possible values: "True" or "False".
- Example value:
- `True` (Default): Notifications for the start of the processing are enabled.

- **COMMBASE_HARDWARE_NOTIFICATION_PROCESSING_STOP_ON**:
- Description: Indicates whether Commbase hardware notifications for the stop of the STT engines processing are enabled or disabled. Check out the other existent Commbase hardware variables.
- Possible values: "True" or "False".
- Example value:
- `True` (Default): Notifications for the stop of the processing are enabled.

- **COMBASE_HARDWARE_DEVICE_0**:
- Description: The path of the hardware device used for communication, for example, an Arduino or any other microcontroller. Check out the other existent Commbase hardware variables.
- Possible values: A valid path to a hardware device.
- Example value:
- `/dev/ttyACM0`: Path to hardware device 0.

- **COMMBASE_HARDWARE_COMMAND_LISTENING_START_FILE**:
- Description: The path to the file containing the command to start STT engines listening on the Commbase hardware. Check out the other existent Commbase hardware variables.
- Possible values: A valid file path.
- Example value:
- `/src/client/serial_communication/arduino/arduino_0/commbase_hardware_notifications/speech_to_text_engine_component/listening_start.dat`: Path to the file for starting the working STT engine listening process.

- **COMMBASE_HARDWARE_COMMAND_LISTENING_STOP_FILE**:
- Description: The path to the file containing the command to stop STT engines listening on the Commbase hardware. Check out the other existent Commbase hardware variables.
- Possible values: A valid file path.
- Example value:
- `WD1` (Default): This tag is used to distinguish or label the specific external storage drive, allowing easy identification and referencing within a system and/or application.
- `/src/client/serial_communication/arduino/arduino_0/commbase_hardware_notifications/speech_to_text_engine_component/listening_stop.dat`: Path to the file for stopping the working STT engine listening process.

- **EXTERNAL_STORAGE_DRIVE_02_TAG**:
- **COMMBASE_HARDWARE_COMMAND_PROCESSING_START_FILE**:
- Description: The path to the file containing the command to start STT engines processing on the Commbase hardware. Check out the other existent Commbase hardware variables.
- Possible values: A valid file path.
- Example value:
- `WD2` (Default): This tag is used to distinguish or label the specific external storage drive, allowing easy identification and referencing within a system and/or application.
- `/src/client/serial_communication/arduino/arduino_0/commbase_hardware_notifications/speech_to_text_engine_component/processing_start.dat`: Path to the file for starting the working STT engine processing.

- **DEV_PROJECT_DIRECTORY_NAME**:
- **COMMBASE_HARDWARE_COMMAND_PROCESSING_STOP_FILE**:
- Description: The path to the file containing the command to stop STT engines processing on the Commbase hardware. Check out the other existent Commbase hardware variables.
- Possible values: A valid file path.
- Example value:
- `YOUR_DEV_PROJECT_DIRECTORY_NAME_HERE` (Default): It can be used to indicate the specific directory or folder where a custom development project is located.
- `/src/client/serial_communication/arduino/arduino_0/commbase_hardware_notifications/speech_to_text_engine_component/processing_stop.dat`: Path to the file for stopping the working STT engine processing.

Please ensure that these environment variables are correctly set with the appropriate values before running the application.

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"messages": [{"language": "en_us"}, {"control": ""}, {"current_request": "tttt"}, {"previous_request": "tttt"}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}
{"messages": [{"language": "en_us"}, {"control": ""}, {"current_request": "--select-stt-engine"}, {"previous_request": "--select-stt-engine"}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}
Loading
Loading