Emacs 中的文本转语音
我不是瞎子,我只是想有一种方法让我的 Windows 机器大声读取缓冲区的内容。以下是基本要求:
- 读取任何英文文本缓冲区。
- 随时暂停阅读并随时恢复(而不是当有人走进我的办公室时等待几分钟等待大缓冲区完成)。
- 调整播放时的读回速度。
- 突出显示当前正在阅读的文本(可选)
我发现了一些可能的解决方案:
- Emacspeak:专为盲人设计。看起来像一个独立的程序,而不是 Emacs 插件
- festival.el:需要节日。我找不到 Festival 的 Windows 二进制文件。有人有吗?
- 我也可以自己写。如今,文本转语音 (TTS) 库非常多。交互式暂停功能可能是最大的技巧,但一定有一些库可以做到这一点。
哪个选项是最好的计划?我不想在这里进行为期一周的项目。在 Windows 中编译 Festival 是一个痛苦的实验。对于我想要的东西来说,Emacspeak 看起来有点矫枉过正。
I'm not blind, I just want to have a way to have my Windows machine read the contents of a buffer outloud. Here are the basic requirements:
- Read any English text buffer.
- Pause the reading at any time and resume at any time (not wait a few minutes for a big buffer to finish when someone walks into my office).
- Adjust the read-back speed at play-time.
- Highlight the text currently being read (optional)
I found a couple of possible solutions:
- Emacspeak: Designed for the blind. Looks like a stand-alone program, not an Emacs plug-in
- festival.el: Requires Festival. I can't find Windows Binaries for Festival. Anyone have them?
- I could also write my own. Text-To-Speech (TTS) libraries are a plenty these days. The interactive pause feature may be the biggest trick, but there must be some libraries that can do it.
Which option is the best plan? I don't want a week-long project here. Compiling Festival in Windows has been a painful experiment. Emacspeak looks like overkill for what I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
适用于 Windows 的 Festival 可在此处获取。我不能保证 Festival.el 可以使用这些二进制文件。不过,我确实有使用这些二进制文件的经验,因此,如果您在使它们在 Emacs 之外工作时遇到问题,我也许可以提供帮助。
我不认为你可以控制节日的播放速度,尽管我可能是错的。至于保持对它的控制,我想说你最好的选择是对其进行编程,以便它一次只向节日发送一小部分。否则,确实没有任何方法可以阻止它在完成之前读取。
基本上,我认为没有任何东西可以在不做一些工作的情况下满足您的最低要求。
编辑:回顾您的要求后,我想说最好的方法是破解 Festival.el 一次向 Festival 发送一句话。然后你可以编写一个击键来杀死它,这样它就只会完成当前的句子。同时,您的脚本可以突出显示当前发送到 Festival 的句子。
Festival for Windows is available here. I can't guarantee that festival.el will work with these binaries. I do have experience working with these binaries, though, so if you have problems getting them to work outside of Emacs, I may be able to help.
I don't think you will have control over playback speed with festival, though I could be mistaken. As far as retaining control over it, I'd say your best bet is to program it so that it is only sending small portions at a time to festival. Otherwise, there really isn't any way to prevent it from reading until done.
Basically, I don't think that there is anything out there that would meet your minimum requirements without some work.
Edit: after looking back over your requirements, I'd say the best approach would be to hack festival.el to send a sentence at a time to Festival. Then you can program a keystroke that will kill it, so that it will only finish the current sentence. At the same time, your script could highlight the sentence that is currently being sent to Festival.
我有一个基于 Python pyttsx 模块的简单解决方案。这将启动一个 python 脚本作为 emacs 进程并向其发送要读取的字符串。
python文件speak.py:
I have a simple solution based on the Python pyttsx module. This starts a python script as an emacs process and sends it strings to be read out.
The python file speak.py: