{"id":13825398,"url":"https://github.com/graynk/voicos","last_synced_at":"2025-05-01T11:33:48.392Z","repository":{"id":49603357,"uuid":"129052913","full_name":"graynk/voicos","owner":"graynk","description":"Simple Telegram bot that converts voice messages to text using Google Speech.","archived":true,"fork":false,"pushed_at":"2022-05-15T06:44:17.000Z","size":30,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-21T23:37:52.195Z","etag":null,"topics":["converts-voice-messages","google-speech","python","python-telegram-bot","telegram-bot","voice-messages"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graynk.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-11T07:28:36.000Z","updated_at":"2025-02-21T18:53:56.000Z","dependencies_parsed_at":"2022-09-22T02:52:25.588Z","dependency_job_id":null,"html_url":"https://github.com/graynk/voicos","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graynk%2Fvoicos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graynk%2Fvoicos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graynk%2Fvoicos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graynk%2Fvoicos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graynk","download_url":"https://codeload.github.com/graynk/voicos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251869414,"owners_count":21657256,"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":["converts-voice-messages","google-speech","python","python-telegram-bot","telegram-bot","voice-messages"],"created_at":"2024-08-04T09:01:20.146Z","updated_at":"2025-05-01T11:33:48.034Z","avatar_url":"https://github.com/graynk.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Voicos\nSimple Telegram bot that converts voice messages to text using Google Speech. Can be found at [@voicos_bot](https://t.me/voicos_bot), but currently disabled, since Google won't accept my credit cards :')\n\n## Dependencies\n* python-telegram-bot\n* pymediainfo (and a system library libmediainfo)\n* google-cloud-speech\n* google-cloud-storage\n* psycopg2-binary (and, well, PostgreSQL itself)\n\n## Installation\n1. Install the libraries via pip:\n```\npip install -r requirements.txt\n```\n2. Go to [Google Cloud](https://cloud.google.com/) and set up a new project. You will need Google Speech API. \n   For messages longer than 1 minute you will also need Google Storage\n3. Generate new service account and download a private key as JSON\n4. Set environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the file path of the JSON key \n   (see [here](https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries) for more instructions)\n5. Go to the Google Storage page and create a new bucket\n6. Message [@BotFather](https://t.me/BotFather) on Telegram to [create a new bot](https://core.telegram.org/bots#6-botfather)\n7. Set up `VOICOS_TOKEN`, `VOICOS_BUCKET` and `VOICOS_ADMIN_ID` environment variables\n8. Set up PostgreSQL and change connection string in bot.py\n9. Run the bot\n`python3 bot.py`\n\n\n## Docker support\nYou will need to pass your credentials JSON to the container and to pass the environment variables with tokens and such.\n\nWith PostgreSQL already set up natively (please don't leave it with open ports, I will not responsible), your run command will look something like this:\n\n```Bash\ndocker run -d --restart unless-stopped --name voicos \\\n   --mount type=bind,source=/path/to/credentials.json,target=/app/credentials.json,readonly \\ \n   --env-file voicos.env \\\n   ghcr.io/graynk/voicos:latest\n```\n\nTo use Postgre in container as well, put `docker-compose.yml`, `credentials.json`, `voicos.env`, `data` directory and your `postgres.conf` \nin the same directory, then run:\n```Bash\nsudo docker-compose up \u0026\n```\n\nHopefully you know what you're doing and can edit `docker-compose.yml` if needed, because I don't have any desire to write a longer instruction than this.\n\n## Usage\nLaunch the bot, forward the voice message, easy. Works in group chats as well. \nFor messages longer than 1 minute the bot uses long recognition with uploading to Google Storage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraynk%2Fvoicos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraynk%2Fvoicos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraynk%2Fvoicos/lists"}