Skip to main content

VoiceRecogMiddleware: A middleware for EFB

Notice

Middleware ID: catbaron.voice_recog

VoiceRecogMiddleware is a middleware for EFB to recognize content of voice message. This middleware is modified based on ehForwarderBot 1.0

example

  • Baidu
    • Deprecated for now because my Baidu account is limited by Baidu
    • 由于我的Baidu账号不能正常登陆,因此对百度引擎的支持暂时停止。
    • API from Baidu is available for free.
    • You need to get API_KEY and SECRET_KEY following http://ai.baidu.com/docs#/ASR-API-PRO/top
  • Azure Cognitive Service
    • Azure Cognitive Service offers 5 audio hours per month for free.
    • You need to get Key1 and Endpoint from https://portal.azure.com/
  • IFlyTek
    • 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.
    • You need to get APPID, APISecret and APIKey from https://console.xfyun.cn/services/iat
  • Tencent
  • You need to use VoiceRecogMiddleware on top of EFB. Please check the document and install EFB first.

Dependense

  • Python >= 3.6
  • EFB >= 2.0.0b15
  • pydub

Install and configuration

Install

pip install efb-voice_recog-middleware

Enable

Register to EFB Following this document to edit the config file. The config file by default is $HOME/.ehforwarderbot/profiles/default/config.yaml. It should look like:

master_channel: foo.demo_master
slave_channels:
- foo.demo_slave
- bar.dummy
middlewares:
- foo.other_middlewares
- catbaron.voice_recog

You only need to add the last line to your config file.

Configure the middleware

The config file by default is $HOME/.ehforwarderbot/profiles/default/catbaron.voice_recog/config.yaml. Please create the config file if thers is not one. Edit it as:

speech_api:
    baidu:
        api_key: API_KEY
        secret_key: SECRET_KEY
        # supported language:
        #   zh, zh-x-en, en, zh-yue, zh-x-sichuan, zh-x-farfield
        lang: zh
    azure:
        key1: KEY_1
        endpoint: ENDPOINT
        # supported language:
        #   ar-EG, ar-SA, ar-AE, ar-KW, ar-QA, ca-ES,
        #   da-DK, de-DE, en-AU, en-CA, en-GB, en-IN,
        #   en-NZ, en-US, es-ES, es-MX, fi-FI, fr-CA,
        #   fr-FR, gu-IN, hi-IN, it-IT, ja-JP, ko-KR,
        #   mr-IN, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT,
        #   ru-RU, sv-SE, ta-IN, te-IN, zh-CN, zh-HK,
        #   zh-TW, th-TH, tr-TR
        lang: zh
    tencent:
        secret_id: SECRET_ID
        secret_key: SECRET_KEY
        # supported language: en, zh
        lang: en
    iflytek:
        app_id: APP_ID
        api_secret: API_SECRET
        api_key: APP_KEY
        # supported language: zh, en
        lang: en
auto: true

Replace the section with all-caps to your own ones.

Note that you may omit the section that you do not want to enable.


Turn off auto if you want to disable auto recognition to all voice messages. Alternatively, you may reply recog` to a voice message to recognise it.

Restart EFB.

Release files for efb-voice-recog-middleware 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for efb-voice-recog-middleware 1.0.3
File Size Uploaded
efb-voice_recog-middleware-1.0.3.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for efb-voice-recog-middleware 1.0.3
File Interpreter ABI Platform
efb_voice_recog_middleware-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / efb-voice_recog-middleware-1.0.3.tar.gz

Download URL efb-voice_recog-middleware-1.0.3.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
99a2706ecd95ff09ae95817327f4e0aecc77c0f1edfb1ad36dc62a5ea0ac2ae6
BLAKE2b-256 checksum
How to use checksums
8a5de9a885dd07819564b53da8458bcad0ea23e34aecc0b52a0564aaf9928382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.9

Release files / efb_voice_recog_middleware-1.0.3-py3-none-any.whl

Download URL efb_voice_recog_middleware-1.0.3-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76287e08282b843d1259b5e9049b790b7b2786ae73ec9168bb3380446ac575a0
BLAKE2b-256 checksum
How to use checksums
10b83cda910d1a1b657ccfd7e8ead6da6e24eddcda5b2c4ee1442f6c40c8cb0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.1

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page