# whisper-keyboard
Video demo: https://www.youtube.com/watch?v=VnFtVR72jM4&feature=youtu.be
Smulate keyboard typing with voice commands on your computer. Use the power of OpenAI's Whisper.
Start the wkey listener. Keep a button pressed (by default: right ctrl) and speak. Your voice will be recoded locally. When the button is released, your command will be transcribed via Whisper and the text will be streamed to your keyboard.
You can use your voice to write anywhere.
You will incur costs for Whisper API. Currently, it costs $0.36 for 1 hour of transcription.
## Setup
Install the package.
```shell
pip install wkey
```
You will need to set two environment variables:
- OPENAI_API_KEY: your personal OpenAI API key. You can get it by signing up here: https://platform.openai.com/
- WKEY: the keyboard key you want to use to start recording. By default, it is set to right ctrl. You can use any key. Note that Mac and Windows might have different key codes. You can run `fkey` to find the code of the key you want to use.
You can set the environment variables in your shell:
```shell
export OPENAI_API_KEY=<your key>
export WKEY=ctrl_r
```
Run `wkey` in a terminal window to start listening.
If there are issues, check the additional requirements.
## Additional requirements
Requirements differ depending on your OS.
### Ubuntu
You will need to install the portaudio library.
```shell
sudo apt-get install portaudio19-dev
```
### Mac
You will need to authorize your terminal to use the microphone and keyboard. Go to System Settings > Privacy and Security. Then:
* Select Microphone and authorize your terminal.
* Select Accessibility and authorize your terminal.
Restart the terminal for the changes to take effect.
Note that this might entail security risks.
### Windows
Haven't tested it on Windows yet. If you do, please let me know how it goes.
## Security risks
This script creates a recording with your microphone and sends the audio to the Whisper API. The Whisper API response will be automatically streamed to your keyboard and executed there. This might entail security risks. Use at your own risk.
Raw data
{
"_id": null,
"home_page": "https://github.com/vlad-ds/whisper-keyboard",
"name": "wkey",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Vlad Gheorghe",
"author_email": "vlad.datapro@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/59/06/b80383fb66e81a323d7da16159a06ef16eb1d6653e0f98e02ca9735db809/wkey-0.2.tar.gz",
"platform": null,
"description": "# whisper-keyboard\n\nVideo demo: https://www.youtube.com/watch?v=VnFtVR72jM4&feature=youtu.be\n\nSmulate keyboard typing with voice commands on your computer. Use the power of OpenAI's Whisper.\n\nStart the wkey listener. Keep a button pressed (by default: right ctrl) and speak. Your voice will be recoded locally. When the button is released, your command will be transcribed via Whisper and the text will be streamed to your keyboard.\n\nYou can use your voice to write anywhere. \n\nYou will incur costs for Whisper API. Currently, it costs $0.36 for 1 hour of transcription.\n\n## Setup\n\nInstall the package.\n\n```shell\npip install wkey\n```\n\nYou will need to set two environment variables:\n\n- OPENAI_API_KEY: your personal OpenAI API key. You can get it by signing up here: https://platform.openai.com/\n- WKEY: the keyboard key you want to use to start recording. By default, it is set to right ctrl. You can use any key. Note that Mac and Windows might have different key codes. You can run `fkey` to find the code of the key you want to use.\n\nYou can set the environment variables in your shell:\n\n```shell\nexport OPENAI_API_KEY=<your key>\nexport WKEY=ctrl_r\n```\n\nRun `wkey` in a terminal window to start listening. \n\nIf there are issues, check the additional requirements.\n\n## Additional requirements\n\nRequirements differ depending on your OS.\n\n### Ubuntu\n\nYou will need to install the portaudio library. \n\n```shell\nsudo apt-get install portaudio19-dev \n```\n\n### Mac\nYou will need to authorize your terminal to use the microphone and keyboard. Go to System Settings > Privacy and Security. Then: \n* Select Microphone and authorize your terminal.\n* Select Accessibility and authorize your terminal.\n\nRestart the terminal for the changes to take effect. \n\nNote that this might entail security risks.\n\n### Windows\nHaven't tested it on Windows yet. If you do, please let me know how it goes.\n\n## Security risks\n\nThis script creates a recording with your microphone and sends the audio to the Whisper API. The Whisper API response will be automatically streamed to your keyboard and executed there. This might entail security risks. Use at your own risk. \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Integrate OpenAI speech-to-text Whisper with your keyboard",
"version": "0.2",
"project_urls": {
"Homepage": "https://github.com/vlad-ds/whisper-keyboard"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8bb2f952e9dbd4e99e3a91f09b8071c760ded03e68c333aa8ccb3147bb8a0eca",
"md5": "994e80daedee1b9d94c47df33f1d1847",
"sha256": "7dfe4442270a3572547992ec664f7aa65c547e6fcffadda4bb633455b16b91ed"
},
"downloads": -1,
"filename": "wkey-0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "994e80daedee1b9d94c47df33f1d1847",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7686,
"upload_time": "2023-08-07T06:11:20",
"upload_time_iso_8601": "2023-08-07T06:11:20.646215Z",
"url": "https://files.pythonhosted.org/packages/8b/b2/f952e9dbd4e99e3a91f09b8071c760ded03e68c333aa8ccb3147bb8a0eca/wkey-0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5906b80383fb66e81a323d7da16159a06ef16eb1d6653e0f98e02ca9735db809",
"md5": "8922034d7dfefc93df12378b16db2f35",
"sha256": "b9b4d61e0a684a7b4d68c1c316fb63f4bd026dff2b943bdead26e34cc4e87a18"
},
"downloads": -1,
"filename": "wkey-0.2.tar.gz",
"has_sig": false,
"md5_digest": "8922034d7dfefc93df12378b16db2f35",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4264,
"upload_time": "2023-08-07T06:11:23",
"upload_time_iso_8601": "2023-08-07T06:11:23.190332Z",
"url": "https://files.pythonhosted.org/packages/59/06/b80383fb66e81a323d7da16159a06ef16eb1d6653e0f98e02ca9735db809/wkey-0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-07 06:11:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "vlad-ds",
"github_project": "whisper-keyboard",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "wkey"
}