From 9672fc8168d2d074e4d0f3fea87de094bc13efe4 Mon Sep 17 00:00:00 2001 From: Max Rohde <1448524+mxro@users.noreply.github.com> Date: Sat, 16 Sep 2023 09:05:42 +1000 Subject: [PATCH] Improving script --- README.md | 15 +++++++++++++++ mywatch.ahk | 16 ++++++++++++++++ script.ahk | 2 +- watch.ahk | 3 +-- 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 mywatch.ahk diff --git a/README.md b/README.md index c90baef..5eed17a 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,14 @@ Use your voice to control Windows 📢 | Open Firefox | Opens Firefox | | Search for cupcake recipes | Opens browser and searches for 'Cupcake Recipes' | | Tell me the first 20 digits of Pi | Shows a window with the 20 first digits of Pi | +| Paste a poem | Pastes a poem | ⚠ WARNING ⚠ This is an experimental application. ChatGPT can end up doing random stuff. So please use with caution! +## How does this work? + +Check out my blog post: TBD + ## Install - Download and install AutoHotKey V1 from [autohotkey.com](https://www.autohotkey.com/) @@ -34,6 +39,16 @@ Use your voice to control Windows 📢 ## Customise +### Trigger Hotkey + +The hotkey to start/stop a voice command is defined in `watch.ahk`. You can replace the following with a hotkey of your choice: + +``` +F8:: +``` + +### Prompt + Among the extracted files, there is a `prompt.txt`. You can edit this to customise it to yor own needs. For instance, the current prompt file defaults to using the [DuckDuckGo](https://duckduckgo.com/) search engine. You can change this easily to any search engine you like, by modifying the following line in `prompt.txt`: diff --git a/mywatch.ahk b/mywatch.ahk new file mode 100644 index 0000000..a0adbba --- /dev/null +++ b/mywatch.ahk @@ -0,0 +1,16 @@ +Capslock::Esc + +F8:: + NotRecording := !NotRecording + If NotRecording + { + Run %A_WorkingDir%\bin\fmedia-1.31-windows-x64\fmedia\fmedia.exe --record --overwrite --out=rec.mp3 --globcmd=listen,, Hide + } + Else + { + Run %A_WorkingDir%\bin\fmedia-1.31-windows-x64\fmedia\fmedia.exe --globcmd=stop,, Hide + Sleep, 100 + Run %A_WorkingDir%\bin\whisper-autohotkey\whisper-autohotkey.exe,, Hide + } + return + diff --git a/script.ahk b/script.ahk index ec4daa7..5ed2edf 100644 --- a/script.ahk +++ b/script.ahk @@ -1,2 +1,2 @@ -Run, https://www.pexels.com/search/beautiful`%20flowers/ +Run, "https://duckduckgo.com/?q=It's`%20a`%20poem`%20in`%20Latin" return \ No newline at end of file diff --git a/watch.ahk b/watch.ahk index a5377dc..0b395fc 100644 --- a/watch.ahk +++ b/watch.ahk @@ -1,5 +1,4 @@ -Capslock::Esc - + F8:: NotRecording := !NotRecording If NotRecording