{"id":19944963,"url":"https://github.com/ehforwarderbot/efb-voice_recog-middleware","last_synced_at":"2025-09-19T11:31:35.929Z","repository":{"id":50014661,"uuid":"325750589","full_name":"ehForwarderBot/efb-voice_recog-middleware","owner":"ehForwarderBot","description":null,"archived":false,"fork":false,"pushed_at":"2021-11-02T12:40:37.000Z","size":91,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T00:27:27.068Z","etag":null,"topics":["efb-middleware","eh-forwarder-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ehForwarderBot.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":"2020-12-31T08:13:24.000Z","updated_at":"2024-02-01T09:02:21.000Z","dependencies_parsed_at":"2022-09-02T14:22:11.659Z","dependency_job_id":null,"html_url":"https://github.com/ehForwarderBot/efb-voice_recog-middleware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehForwarderBot%2Fefb-voice_recog-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehForwarderBot%2Fefb-voice_recog-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehForwarderBot%2Fefb-voice_recog-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehForwarderBot%2Fefb-voice_recog-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehForwarderBot","download_url":"https://codeload.github.com/ehForwarderBot/efb-voice_recog-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233566886,"owners_count":18695290,"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":["efb-middleware","eh-forwarder-bot"],"created_at":"2024-11-13T00:23:37.759Z","updated_at":"2025-09-19T11:31:30.648Z","avatar_url":"https://github.com/ehForwarderBot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VoiceRecogMiddleware: A middleware for EFB \n\n## Notice\n\n**Middleware ID**: `catbaron.voice_recog`\n\n**VoiceRecogMiddleware** is a middleware for EFB to recognize content of voice message.\nThis middleware is modified based on `ehForwarderBot 1.0`\n\n![example](./example.jpg)\n\n- Baidu\n    - **Deprecated for now because my Baidu account is limited by Baidu**\n    - **由于我的Baidu账号不能正常登陆，因此对百度引擎的支持暂时停止。**\n    - API from Baidu is available for free. \n    - You need to get `API_KEY` and `SECRET_KEY` following\n    http://ai.baidu.com/docs#/ASR-API-PRO/top\n- Azure Cognitive Service\n    - Azure Cognitive Service offers 5 audio hours per month for free.\n    - You need to get `Key1` and `Endpoint` from https://portal.azure.com/\n- IFlyTek\n    - IFlyTek offers 500 queries per day fro free to new users. Additional free bundles are available from 50,000 queries/90 days to 100,000 queries/year.\n    - You need to get `APPID`, `APISecret` and `APIKey` from https://console.xfyun.cn/services/iat\n- Tencent\n    - Tencent offers 15,000 queries for free per month.\n    - Chinese ID verification is required to use free service.\n    - You need to get `SecretID` and `SecretKey` from https://console.cloud.tencent.com/cam/capi\n-  You need to use **VoiceRecogMiddleware** on top of\n   [EFB](https://ehforwarderbot.readthedocs.io). Please check the\n   document and install EFB first.\n\n## Dependense\n* Python \u003e= 3.6\n* EFB \u003e= 2.0.0b15\n* pydub\n\n## Install and configuration\n\n### Install \n```\npip install efb-voice_recog-middleware\n```\n\n### Enable\n\nRegister to EFB\nFollowing [this document](https://ehforwarderbot.readthedocs.io/en/latest/getting-started.html) to edit the config file. The config file by default is `$HOME/.ehforwarderbot/profiles/default/config.yaml`. It should look like:\n\n```yaml\nmaster_channel: foo.demo_master\nslave_channels:\n- foo.demo_slave\n- bar.dummy\nmiddlewares:\n- foo.other_middlewares\n- catbaron.voice_recog\n```\n\nYou only need to add the last line to your config file.\n\n### Configure the middleware\n\nThe config file by default is `$HOME/.ehforwarderbot/profiles/default/catbaron.voice_recog/config.yaml`.\nPlease create the config file if thers is not one.  Edit it as:\n\n```yaml\nspeech_api:\n    baidu:\n        api_key: API_KEY\n        secret_key: SECRET_KEY\n        # supported language:\n        #   zh, zh-x-en, en, zh-yue, zh-x-sichuan, zh-x-farfield\n        lang: zh\n    azure:\n        key1: KEY_1\n        endpoint: ENDPOINT\n        # supported language:\n        #   ar-EG, ar-SA, ar-AE, ar-KW, ar-QA, ca-ES,\n        #   da-DK, de-DE, en-AU, en-CA, en-GB, en-IN,\n        #   en-NZ, en-US, es-ES, es-MX, fi-FI, fr-CA,\n        #   fr-FR, gu-IN, hi-IN, it-IT, ja-JP, ko-KR,\n        #   mr-IN, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT,\n        #   ru-RU, sv-SE, ta-IN, te-IN, zh-CN, zh-HK,\n        #   zh-TW, th-TH, tr-TR\n        lang: zh\n    tencent:\n        secret_id: SECRET_ID\n        secret_key: SECRET_KEY\n        # supported language: en, zh\n        lang: en\n    iflytek:\n        app_id: APP_ID\n        api_secret: API_SECRET\n        api_key: APP_KEY\n        # supported language: zh, en\n        lang: en\nauto: true\n```\n\nReplace the section with all-caps to your own ones.\n\nNote that you may omit the section that you do not want to enable.\n\n---\nTurn off `auto` if you want to disable auto recognition to all voice\nmessages. Alternatively, you may reply \u003ccode\u003erecog`\u003c/code\u003e to a voice\nmessage to recognise it.\n\n### Restart EFB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehforwarderbot%2Fefb-voice_recog-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehforwarderbot%2Fefb-voice_recog-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehforwarderbot%2Fefb-voice_recog-middleware/lists"}