zoukankan      html  css  js  c++  java
  • reading words in your computer and changing to female voice, linux festival text2wave saving wav files

    on a brand new linux PC, e.g. ubuntu 14.04 amd64

    To hear voice

    sudo apt-get install festival -y

    then try to hear some thing from your PC

    echo "I am your computer." | festival --tts 
    # or
    echo "I am your computer." | festival --tts --pipe

    you will hear something out.

    Now replace the voice files, a better one.

    Tutorial from https://www.youtube.com/watch?v=4eJTDpAeBSk

    To replace voice

    commands including:

    apt-get install festival
    sudo su
    cd /usr/share/festival/voices/english/
    wget -c http://www.speech.cs.cmu.edu/cmu_arctic/packed/cmu_us_clb_arctic-0.95-release.tar.bz2
    tar jxf cmu_us_clb_arctic-0.95-release.tar.bz2
    ln -s cmu_us_clb_arctic cmu_us_clb_arctic_clunits
    echo "(set! voice_default 'voice_cmu_us_clb_arctic_clunits)" >> /etc/festival.scm

    Then go to command line

    $~ festival
    festival> (SayText "Hello world")

    You will hear something different, a female voice would come out.

    To save wave files

    echo "Hello I am Lily. " > /tmp/one.txt
    text2wave < /tmp/one.txt > /tmp/voice.wav
    mplayer /tmp/voice.wav

    Your voice file has been saved.

    Happy hacking!

    * Updated in the morning 09:17 A.M.

    To hear selected text in your PC

    Now I am going to teach you how to make it in ubuntu 14.04 AMD64

    sudo apt-get install xsel -y
    sudo su
    cat >> /usr/local/bin/xread <<EOF
    # Then input
    > #!/bin/bash
    > xsel | festival --tts --pipe
    > EOF

    Then create a keyboard shortcut in your PC. KDE/Gnome/Xfce4/Cinnamon/Mate/LXDE or any kind of desktop environment which is based on Xorg services.

    In this case, I map the keys <Meta> + <r> in ubuntu 14.04 AMD64. Actually the <Meta> key is the *windows* key which is useless in Linux. Here I just took good use of that. This shortcut will trigger the script "/usr/local/bin/xread" which uses tools "xsel" and "festival".

    Use your cursor and select any text area in your PC, browser, console, text editor or anywhere and then press keys <Meta> + <r>. Then you will hear the text voice.

    Happy hacking!

  • 相关阅读:
    内存泄漏 Memory Leaks 内存优化 MD
    Handler Thread 内部类引起内存泄露分析
    为什么不取消注册BroadcastReceiver会导致内存泄漏
    WebChromeClient 简介 API 案例
    WebViewClient 简介 API 案例
    java.net.URI 简介 文档 API
    android.net.Uri 简介 API
    RV 多样式 MultiType 聊天界面 消息类型 MD
    JS函数声明与定义,作用域,函数声明与表达式的区别
    CSS中table tr:nth-child(even)改变tr背景颜色: IE7,8无效
  • 原文地址:https://www.cnblogs.com/spaceship9/p/4884175.html
Copyright © 2011-2022 走看看