java 语音合成并生成wav文件
1.下载jacob文件,根据自己操作系统,将jacob-1.18-x64.dll文件复制到C:/windows/System32文件夹中 下载链接: https://pan.baidu.com/s/1mimoaBeFhzVMsGOLzsvpBw 提取码: wsfz 2.pom.xml引入依赖 <!--文字转语音--> <dependency> <groupId>com.hynnet</groupId> <artifactId>jacob</artifactId> <version>1.18</version> </dependency> 3.代码 import com.jacob.activeX.ActiveXComponent; import com.jacob.com.Dispatch; import com.jacob.com.Variant; public class ReadText { public static void main(String[] args) { // ActiveXComponent sap = new ActiveXComponent("Sapi.SpVoice"); //// // Dispatch是做什么的? // Dispatch sapo = sap.getObject(); try { // // 音量 0-100 // sap