如何通过使用命令行从输入的文本中获取语音输出?
同时还可以使用简单的命令来更改语速、音调、音量等功能。
同时还可以使用简单的命令来更改语速、音调、音量等功能。
say使用GNUstep语音引擎将文本转换为可听的语音。
sudo apt-get install gnustep-gui-runtime
say "hello"
festival通用多语言语音合成系统。
sudo apt-get install festival
echo "hello" | festival --tts
spd-say向speech-dispatcher发送文本到语音输出请求
sudo apt-get install speech-dispatcher
spd-say "hello"
espeak是一个多语言软件语音合成器。
sudo apt-get install espeak
espeak "hello"
spd-say
在14.04及以后的版本中似乎是预装的:http://releases.ubuntu.com/trusty/ubuntu-14.04.4-desktop-amd64.manifest - Ciro Santilli OurBigBook.comsudo pip install gTTS
,(Google Text to Speech/https://github.com/pndurette/gTTS),然后`gtts-cli "hello" -o hello.mp3你也可以将其导入到
mpg123 -中。
gtts-cli "why, hello there" | mpg123 -`。 - Elijah Lynnspd-say
似乎无法同时播放TTS,只能一次播放一个。 - phil294espeak
/spd-say
是制作梗最好的工具(其他工具甚至无法正确发音“梗”这个词)。据我所知,spd-say
使用 espeak
作为其后端引擎(声音听起来一样)。 - QwertyChouskiesudo apt-get install espeak
espeak --stdout "this is a test" | paplay
espeak --help
命令可以显示调整阅读速度、音高、声音等选项。
当你在做笔记时,将它们保存为文本文件,然后执行以下操作:
echo "these are my notes" > text.txt
espeak --stdout -f text.txt > text.wav
paplay text.wav # you should hear "these are my notes"
man spd-say
中:spd-say "<type text>"
例:
spd-say "Welcome to Ubuntu Linux"
spd-say -t female2 "text"
让它变得可忍 - scorpiodawgPython 谷歌语音:
pip install google_speech
google_speech "Test the hello world"
来自安卓的Svox:
apt-get install svox-pico
pico2wave --wave=test.wav "Test the hello world"
play test.wav
Svox Nanotts:
git clone https://github.com/gmn/nanotts.git
cd nanotts
make
./nanotts -v en-US "Test the hello world"
google_speech
,我需要安装python3-pip
和libsox-fmt-mp3
,然后使用pip3 install google_speech
。 - artmMbrola从11.10开始无法使用。
SVOX(pico)工具容易安装,易于使用,并在Ubuntu中提供良好质量的语音。安装它:
sudo apt-get install libttspico0 libttspico-utils libttspico-data
设置Read Text扩展的选项,方法是在工具 - 插件 - 读取选择...中使用/usr/bin/python作为外部程序。选择一个包含令牌(PICO_READ_TEXT_PY)的命令行选项。
这是我使用的工具。它听起来很自然,容易理解,并且能够识别单位(米、摄氏度、千克等)。
这里是我关于pico2wave的第一篇文章。
你只需要做以下几步:打开Ubuntu软件中心,搜索"pico"。你会找到4或5个带有"Small Footprint Ling..."的条目。安装它们。
pico2wave的一个可能用途在我的第一篇文章中有描述(点击上面的链接查看)。
wine
运行...(有时当我离开阅读器时,它会有一些小问题,需要点击面板。与从NatualVoices获得的语音质量相比,这只是一个小问题。)sudo apt-get install festival
echo "hello" | festival --tts
~/.festivalrc
文件,并将以下内容复制进去:(Parameter.set 'Audio_Command "play -b 16 -c 1 -e signed-integer -r $SR -t raw $FILE tempo 1.5 pitch -100")
(Parameter.set 'Audio_Method 'Audio_Command)
sudo apt-get install festvox-kallpc16k
play
是一个随着sox
软件包一起提供的命令行命令。sudo apt-get install sox