linux 下使用 google tts 做语音朗读
google tts 文本转语音 python 库: https://github.com/hungtruong/Google-Translate-TTS - $ python GoogleTTS.py -l zh-CN -f abc中文朗读测试.txt
-
- #生成out.mp3
复制代码不过又发现了个最简单的办法,直接执行 - gamexg@ubuntu:~/yysb$ mplayer "http://translate.google.cn/translate_tts?ie=UTF-8&q=abc中文 朗读测试&tl=zh-CN"
- MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
- mplayer: could not connect to socket
- mplayer: No such file or directory
- Failed to open LIRC support. You will not be able to use your remote control.
-
- Playing http://translate.google.cn/translate_tts?ie=UTF-8&q=abc中文朗读测试&tl=zh-CN.
- Resolving translate.google.cn for AF_INET6...
- Connecting to server translate.google.cn[2404:6800:4008:c00::a0]: 80...
-
- Failed to connect to server with AF_INET6
- Resolving translate.google.cn for AF_INET...
- Connecting to server translate.google.cn[203.208.41.148]: 80...
-
- Cache size set to 320 KBytes
- Cache fill: 3.76% (12330 bytes)
-
- Detected file format: Audio only
- ==========================================================================
- Requested audio codec family [mpg123] (afm=mpg123) not available.
- Enable it at compilation.
- Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
- AUDIO: 22050 Hz, 1 ch, floatle, 32.0 kbit/4.54% (ratio: 4000->88200)
- Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
- ==========================================================================
- AO: [pulse] 22050Hz 1ch floatle (4 bytes per sample)
- Video: no video
- Starting playback...
- A: 3.0 (03.0) of 3.0 (03.0) 0.1% 0%
-
-
- Exiting... (End of file)
- gamexg@ubuntu:~/yysb$
复制代码 |