Was this page helpful?

多國 TTS - Microsoft TTS


    Microsoft TTS Service

    AGI 官網:http://zaf.github.com/asterisk-mstts/

    Microsoft TTS 特性


    • perl
    • perl-libwww
    • sox
    • API Key (向 Microsoft 免費申請)
    • 網際網路



    1. 下載 AGI
    2. 修改 AGI 輸入 API ID
    3. 編輯 dialplan

    下載 AGI

    cd /usr/src
    wget --no-check-certificate https://github.com/downloads/zaf/asterisk-mstts/asterisk-mstts-0.1.tar.gz
    tar xzf asterisk-mstts-0.1.tar.gz
    cd asterisk-mstts-0.1
    cp mstts.agi /var/lib/asterisk/agi-bin
    chown asterisk:asterisk /var/lib/asterisk/agi-bin/mstts.agi
    chmod 0755 /var/lib/asterisk/agi-bin/mstts.agi

    修改 mstts.agi

    # ----------------------------- #
    #   User defined parameters:    #
    # ----------------------------- #
    #  App ID from MS               #
    my $appid   = "HereisyourAPPID";
    # Default language              #
    my $lang = "en";

    編輯 dialplan

    ;MsTTS Demo
    exten => s,1,Answer()
     same => n,Wait(1)
     ;;Speak English:
     same => n,agi(mstts.agi,"Welcome to OSSLab, This is a simple text to speech synthesis test in english.",en)
     ;;Speak Mandarin of Taiwan
     same => n,agi(mstts.agi,"歡迎來到,開放軟體實驗室,這是一個簡單的文字轉語音合成測試。",zh-tw)
     ;;Speak Mandarin of China
     same => n,agi(mstts.agi,"欢迎来到,开放软体实验室,这是一个简单的文字转语音合成测试。",zh-cn)
     same => n,Hangup


    agi(mstts.agi,text,[language],[intkey]): This will invoke the MS Translator TTS engine, render the text string to speech and play it back to the user. If 'intkey' is set the script will wait for user input. Any given interrupt keys will cause the playback to immediately terminate and the dialplan to proceed to the matching extension (for use in IVR).

    The script contacts MS TTS service in order to get the voice data which then stores in a local cache (by default /tmp/) for future use. Parameters like default language, enabling or disabling caching and cache dir can be set up by editing the script.


    ca,     ca-es,    da,    da-dk,
    de,     de-de,    en,    en-au,
    en-ca,  en-gb,    en-in, en-us,
    es,     es-es,    es-mx, fi,
    fi-fi,  fr,       fr-ca, fr-fr,
    it,     it-it,    ja,    ja-jp,
    ko,     ko-kr,    nb-no, nl,
    nl-nl,  no,       pl,    pl-pl,
    pt,     pt-br,    pt-pt, ru,
    ru-ru,  sv,       sv-se, zh-chs,
    zh-cht, zh-cn,    zh-hk, zh-tw

    Was this page helpful?
    標籤 (Edit tags)
    • No tags

    文件 1

    58.62 KB09:27, 24 Mar 2012alang動作
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core