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 #467

Merged
merged 6 commits into from
Mar 4, 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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ This project is coded and organized like this:
│ ├── commbase-llm-google-gemini-p
│ ├── commbase-llm-meta-llama-p
│ ├── commbase-llm-openai-gpt-p
│ ├── commbase-recorder-transmitter-b
│ ├── commbase-recorder-transmitter-s
│ ├── commbase-stt-whisper-proactive-p
│ │ └── examples
│ ├── commbase-stt-whisper-reactive-remote-p
│ ├── commbase-stt-whisper-reactive-p
│ │ ├── client_data
│ │ └── examples
│ ├── commbase-tts-gTTS
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"messages": [{"control": "stop_previous_command"}, {"current_request": "Okay accept."}, {"previous_request": "Okay accept."}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}
{"messages": [{"control": ""}, {"current_request": "sto"}, {"previous_request": "sto"}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}
1 change: 1 addition & 0 deletions bundles/commbase-recorder-transmitter-b/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# commbase-recorder-transmitter-b
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
################################################################################
# commbase-stt-whisper-reactive-p #
# commbase-recorder-transmitter-b #
# #
# A reactive version of STT ASR (Automatic Speech Recognition) engine. #
# #
Expand Down Expand Up @@ -30,11 +30,11 @@
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #

# rec-comm.sh
# reccomm.sh
# Records audio when specific key is pressed, using the arecord command. Sends
# the recorded audio file to a remote host using scp when a specific key is
# pressed again.
# Requires the packages already installed:
# Required packages:
# alsa-utils
# openssh-client
# openssh server
Expand Down
1 change: 1 addition & 0 deletions bundles/commbase-recorder-transmitter-s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# commbase-recorder-transmitter-s
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
################################################################################
# commbase-stt-whisper-reactive-p #
# commbase-recorder-transmitter-s #
# #
# A reactive version of STT ASR (Automatic Speech Recognition) engine. #
# #
Expand Down Expand Up @@ -30,11 +30,11 @@
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #

# rec-comm.sh
# recccom.sh
# Records audio when specific key is pressed, using the arecord command. Sends
# the recorded audio file to a remote host using scp when a specific key is
# pressed again.
# Requires the packages already installed:
# Required packages:
# alsa-utils
# openssh-client
# openssh server
Expand Down
Binary file modified bundles/commbase-stt-whisper-reactive-p/client_data/recording.wav
Binary file not shown.
24 changes: 12 additions & 12 deletions bundles/libcommbase/libcommbase/routines/text_animation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
# animation <"text"> <delay>

animate_text() {
local text="$1"
local delay="$2"
local text="$1"
local delay="$2"

while true; do
clear
for ((i = 0; i < ${#text}; i++)); do
echo -n "${text:$i:1}"
sleep "$delay"
done
clear
echo
while true; do
clear
for ((i = 0; i < ${#text}; i++)); do
echo -n "${text:$i:1}"
sleep "$delay"
done
clear
echo
done
}

# Check if both text and delay are provided as arguments
if [ $# -ne 2 ]; then
echo "Usage: $0 <text> <delay>"
exit 1
echo "Usage: $0 <text> <delay>"
exit 1
fi

text="$1"
Expand Down
19 changes: 19 additions & 0 deletions data/.chat_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,22 @@
🧑 END USER:
🧑 END USER: I have changed the parts to the engine.
🧑 END USER: Press a key to record.
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
2 changes: 1 addition & 1 deletion data/.messages.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"messages":[{"control":"stop_previous_command"},{"current_request":"Okay accept."},{"previous_request":"Okay accept."},{"current_response":""},{"runtime":""},{"source_code_display":""},{"source_code":""}]}
{"messages":[{"control":""},{"current_request":"sto"},{"previous_request":"sto"},{"current_response":""},{"runtime":""},{"source_code_display":""},{"source_code":""}]}
22 changes: 6 additions & 16 deletions src/app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,31 @@ app() {
# Pane 1
# On window 0, select pane 1, open or create the chatroom file
(tmux select-pane -t 1 && tmux send-keys " touch $COMMBASE_APP_DIR$CHAT_LOG_FILE" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 1 && tmux send-keys " clear && PS1=""" C-m);
# Run tail_chat_log and then press the enter key
(tmux select-pane -t 1 && tmux send-keys " bash $tail_chat_log" C-m && sleep $time);
(tmux select-pane -t 1 && tmux send-keys " clear; bash $tail_chat_log" C-m && sleep $time);

# Pane 3
# On window 0, select pane 3, activate the conda environment if it exists,
# send the enter key, and sleep.
(tmux select-pane -t 3 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 3 && tmux send-keys " clear && PS1=""" C-m);
# Run commbase-data-exchange server and then press enter
(tmux select-pane -t 3 && tmux send-keys " $PYTHON_ENV_VERSION $COMMBASE_DATA_EXCHANGE_SERVER_CONNECTION_FILE_PATH" C-m && sleep $time);
(tmux select-pane -t 3 && tmux send-keys " clear; $PYTHON_ENV_VERSION $COMMBASE_DATA_EXCHANGE_SERVER_CONNECTION_FILE_PATH" C-m && sleep $time);
# Check the connection to the server before starting the client
(check_data_exchange_server_connection)

# Pane 2
# On window 0, select pane 2, activate the conda environment if it exists,
# send the enter key, and sleep.
(tmux select-pane -t 2 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 2 && tmux send-keys " clear && PS1=""" C-m);
# Run commbase-data-exchange client and then press enter
(tmux select-pane -t 2 && tmux send-keys " $PYTHON_ENV_VERSION $COMMBASE_DATA_EXCHANGE_CLIENT_CONNECTION_FILE_PATH" C-m && sleep $time);
(tmux select-pane -t 2 && tmux send-keys " clear; $PYTHON_ENV_VERSION $COMMBASE_DATA_EXCHANGE_CLIENT_CONNECTION_FILE_PATH" C-m && sleep $time);

# Pane 4
# On window 0, select pane 4, activate the conda environment if it exists,
# send the enter key, and sleep.
(tmux select-pane -t 4 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Run the STT_ENGINE_STRING and then press the enter
(tmux select-pane -t 4 && tmux send-keys " cpulimit --limit=$STT_PROCESS_CPU_LIMIT_PERCENTAGE -- $STT_ENGINE_STRING" C-m && sleep $time);
(tmux select-pane -t 4 && tmux send-keys " clear; cpulimit --limit=$STT_PROCESS_CPU_LIMIT_PERCENTAGE -- $STT_ENGINE_STRING" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 4 && tmux send-keys " clear && PS1=""" C-m);

Expand All @@ -116,19 +110,15 @@ app() {
# On window 0, select pane 5, activate the conda environment if it exists,
# send the enter key, and sleep.
(tmux select-pane -t 5 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 5 && tmux send-keys " cd $COMMBASE_APP_DIR ; clear && PS1=""" C-m);
# Run text_animation and then press enter
(tmux select-pane -t 5 && tmux send-keys " bash $text_animation 'Commbase' 0.5" C-m && sleep $time);
(tmux select-pane -t 5 && tmux send-keys " clear; bash $text_animation 'Commbase' 0.5" C-m && sleep $time);

# Pane 6
# On window 0, select pane 6, activate the conda environment if it exists,
# send the enter key, and sleep.
(tmux select-pane -t 6 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Clear the screen, and set the prompt to an empty string
(tmux select-pane -t 6 && tmux send-keys " cd $COMMBASE_APP_DIR ; clear && PS1=""" C-m);
# Run alsamixer and then press enter
(tmux select-pane -t 6 && tmux send-keys " alsamixer --view=capture" C-m);
(tmux select-pane -t 6 && tmux send-keys " clear; alsamixer --view=capture" C-m);

# In this section, activate/deactivate or add custom extra windows

Expand Down
Loading