我在线程中调用 sapi,收到错误代码:OLE 错误 80045006
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleException with message 'OLE error 80045006'.
---------------------------
Break Continue Help
---------------------------
我已经调用了CoInitialize。我的代码是:
hr := CoInitialize(nil);
SpVoice := TSpVoice.Create(Application);
SpVoice.Connect;
SpVoice.Speak('Test text');
CoUninitialize;
并且只有当我选择 neospeech 语音时才会发生错误。
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleException with message 'OLE error 80045006'.
---------------------------
Break Continue Help
---------------------------
i have called CoInitialize. My code is :
hr := CoInitialize(nil);
SpVoice := TSpVoice.Create(Application);
SpVoice.Connect;
SpVoice.Speak('Test text');
CoUninitialize;
and the error only happened when i select the neospeech voice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误 0x80045006 是 SPERR_DEVICE_BUSY:硬件设备正在被另一个线程或进程使用。 MSDN 说:在许多旧系统中,音频输出设备只能由单个进程打开。在 Windows XP 之前的 Windows 版本中,只有单个进程可以打开音频输入设备。因此,如果尝试打开正在由不同进程或线程使用的设备,则 SPERR_DEVICE_BUSY 将返回。在Windows XP(及更高版本)中,多个进程可以打开同一个音频设备
Error 0x80045006 is SPERR_DEVICE_BUSY: Hardware device is in use by another thread or process. MSDN Says: in many older systems, audio output devices can be opened only by a single process. In versions of Windows previous to Windows XP, only a single process can open an audio input device. Therefore, SPERR_DEVICE_BUSY will return if an attempt is made to open a device that is being used by a different process or thread. In Windows XP (and higher), multiple processes can open the same audio device