CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 8066|回复: 0

linux 下使用 google tts 做语音朗读

[复制链接]
发表于 2013-12-4 11:00:55 | 显示全部楼层 |阅读模式
linux 下使用 google tts 做语音朗读

google tts 文本转语音 python 库:
https://github.com/hungtruong/Google-Translate-TTS
  1. $ python GoogleTTS.py -l zh-CN -f abc中文朗读测试.txt

  2. #生成out.mp3
复制代码
不过又发现了个最简单的办法,直接执行
  1. gamexg@ubuntu:~/yysb$ mplayer "http://translate.google.cn/translate_tts?ie=UTF-8&q=abc中文 朗读测试&tl=zh-CN"
  2. MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
  3. mplayer: could not connect to socket
  4. mplayer: No such file or directory
  5. Failed to open LIRC support. You will not be able to use your remote control.

  6. Playing http://translate.google.cn/translate_tts?ie=UTF-8&q=abc中文朗读测试&tl=zh-CN.
  7. Resolving translate.google.cn for AF_INET6...
  8. Connecting to server translate.google.cn[2404:6800:4008:c00::a0]: 80...

  9. Failed to connect to server with AF_INET6
  10. Resolving translate.google.cn for AF_INET...
  11. Connecting to server translate.google.cn[203.208.41.148]: 80...

  12. Cache size set to 320 KBytes
  13. Cache fill:  3.76% (12330 bytes)

  14. Detected file format: Audio only
  15. ==========================================================================
  16. Requested audio codec family [mpg123] (afm=mpg123) not available.
  17. Enable it at compilation.
  18. Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
  19. AUDIO: 22050 Hz, 1 ch, floatle, 32.0 kbit/4.54% (ratio: 4000->88200)
  20. Selected audio codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio)
  21. ==========================================================================
  22. AO: [pulse] 22050Hz 1ch floatle (4 bytes per sample)
  23. Video: no video
  24. Starting playback...
  25. A:   3.0 (03.0) of 3.0 (03.0)  0.1% 0%


  26. Exiting... (End of file)
  27. gamexg@ubuntu:~/yysb$
复制代码

评分

参与人数 1威望 +10 金钱 +20 贡献 +10 收起 理由
soloforce + 10 + 20 + 10 赞一个!

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-5-19 08:39 , Processed in 0.021232 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部