Perl 中的语音合成
是否可以让计算机(windows或linux、mac)用perl说话?我知道用VB脚本是可以的。但是 Perl 怎么样?
在 VB 中,我们只需编写
CreateObject("SAPI.SpVoice").Speak"I can speak "
How do we do this in perl ?
Is it possible to make computer (windows or linux, mac) speak in perl ? I know it is possible with VB script. But how about perl ?
In VB we just write
CreateObject("SAPI.SpVoice").Speak"I can speak "
How do we do this in perl ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Speech::Synthesis 模块可以连接到 Microsoft 的 SAPI 5 API,看起来如此就像你在VB中使用的一样。还有 Win32::SAPI5,它是 Windows 特定的,但可能提供更多控制,或者您可以只使用 Win32::OLE:
当然,如果您要多次说话,您可能只想创建该对象一次,将其存储在变量中,然后调用
多次讲
。The Speech::Synthesis module can interface to Microsoft's SAPI 5 API, which it looks like you're using in VB. There's also Win32::SAPI5, which is Windows-specific but may offer more control, or you can just use Win32::OLE:
Of course, if you're going to speak multiple times, you'd probably want to create the object only once, store it in a variable, and call
Speak
multiple times on it.快速 CPAN 搜索显示 PerlSpeak, 语音::合成和语音::eSpeak< /a> 都能够进行语音合成。
A quick CPAN search shows that PerlSpeak, Speech::Synthesis, and Speech::eSpeak all are capable of speech synthesis.