{"id":13337212,"url":"https://github.com/T-vK/Termux-DeepSpeech","last_synced_at":"2025-03-11T04:32:08.362Z","repository":{"id":41132929,"uuid":"226366474","full_name":"T-vK/Termux-DeepSpeech","owner":"T-vK","description":"Open source offline speech recognition for Android using Mozilla's DeepSpeech in Termux","archived":false,"fork":false,"pushed_at":"2022-07-16T13:00:12.000Z","size":26,"stargazers_count":44,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-04T16:19:45.826Z","etag":null,"topics":["android","bash","deepspeech","mozilla","offline","open-source","speech-recognition","termux"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/T-vK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-06T16:16:20.000Z","updated_at":"2023-02-01T17:32:02.000Z","dependencies_parsed_at":"2022-07-16T18:16:48.959Z","dependency_job_id":null,"html_url":"https://github.com/T-vK/Termux-DeepSpeech","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FTermux-DeepSpeech","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FTermux-DeepSpeech/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FTermux-DeepSpeech/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-vK%2FTermux-DeepSpeech/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-vK","download_url":"https://codeload.github.com/T-vK/Termux-DeepSpeech/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213069641,"owners_count":15532824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","bash","deepspeech","mozilla","offline","open-source","speech-recognition","termux"],"created_at":"2024-07-29T19:12:53.177Z","updated_at":"2024-10-23T15:32:05.521Z","avatar_url":"https://github.com/T-vK.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Open source offline speech recognition for Android using Mozilla's DeepSpeech in Termux\n\n## Requirements\n- ~3GB of disk space during installation; afterwards only ~2GB\n- [Termux](https://f-droid.org/app/com.termux)\n- [Termux:API](https://f-droid.org/app/com.termux.api)\n\n## Installation\n\n- Install the following (open source) apps: Termux, Termux:API\n- Open Termux and run\n    `pkg i -y git \u0026\u0026 git clone https://github.com/T-vK/Termux-DeepSpeech.git \u0026\u0026 cd ./Termux-DeepSpeech \u0026\u0026 ./speech2text`\n\nThis will take a while beacuse it needs to download a pre-trained DeepSpeech model and a DeepSpeech release. It will probably also ask for microphone permissions (which are required for obvious reasons).\n\n## Usage\nIf the installation was successful, you should now be able to use command `speech2text`.\n`speech2text` will listen to your microphone for (by default) 2 seconds and then print the words that were recognized.\n\n## Advanced usage\nYou could create bash scripts like this:\n``` bash\n#!/data/data/com.termux/files/usr/bin/bash\n\nWORDS=\"$(speech2text)\"                            # This will listen to the microphone for (by default) 2 seoncds and the write what you said in the variable WORDS\n\necho \"Recognized: $WORDS\"                         # Show what you just said\n\nif [[ \"$WORDS\" =~ \"light\" ]]; then                # If what you said contained the word \"light\"\n    if [[ $WORDS =~ \"on\" ]]; then                 # If what you said contained the word \"on\"\n        termux-tts-speak \"Turning flashlight on\"  # Let a robot voice say \"Turning flashlight on\"\n        termux-torch on                           # Turn the flashlight on\n    elif [[ $WORDS =~ \"of\" ]]; then               # If what you said contained the word \"of\"\n        termux-tts-speak \"Turning flashlight off\" # Let a robot voice say \"Turning flashlight off\"\n        termux-torch off                          # Turn the flashlight off\n    fi\nelif [[ \"$WORDS\" =~ \"heating\" ]] || [[ \"$WORDS\" =~ \"temperature\" ]]; then   # If what you said contained the word \"heating\" or \"temerature\"\n    # Do whatever here...\n    echo \"Hello\"\nelse\n    termux-tts-speak \"You said: $WORDS\"           # Let a robot voice repeat what it thought you said...\nfi\n```\n\nIf you install the [Termux:Widget](https://f-droid.org/app/com.termux.widget) app and save the above script under \"$HOME/.shortcuts/tasks/\" and make it executable for example like this: `chmod +x \"$HOME/.shortcuts/tasks/speech-command\"` (speech-command is the name of the script).\nYou can then then create a widget that triggers the script. Or using the app [HomeBot](https://f-droid.org/app/com.abast.homebot) (open source) you can remap long-pressing the home button which usually triggers the Google voice assistent to run your speech-command script.\n\n\n## Warning\n\nThis is a very new script that has barely been tested. You might also have to install a TTS Engine ([Flite TTS Engine](https://f-droid.org/app/edu.cmu.cs.speech.tts.flite) is a good open source one) because I'm using text-to-speech commands a few times in the `Advanced usage` example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-vK%2FTermux-DeepSpeech","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FT-vK%2FTermux-DeepSpeech","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-vK%2FTermux-DeepSpeech/lists"}