我想使用 Angular 进行语音合成。就像在这个项目中一样: https://codesandbox.io/s/rmloxx60q4 但是,我的角度项目中的“从‘speak-tts’导入语音”会引发以下错误。
index.js:561 [webpack-dev-server] ERROR
src/app/pages/oled-page/oled-page.component.ts:11:20 - error TS7016: Could not find a declaration file for module 'speak-tts'. 'C:/Angular/product_display_system/frontend/node_modules/speak-tts/lib/speak-tts.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/speak-tts` if it exists or add a new declaration (.d.ts) file containing `declare module 'speak-tts';`
11 import Speech from 'speak-tts'
关于如何解决这个问题有什么建议吗?安装命令
npm i --save-dev @types/speak-tts
没有任何作用...
我使用了 JS 库:https://responsivevoice.org/ 我得到了我想要的结果