首先pom文件中引用依赖com.hynnetjacob1.18方法:/***的路径可自行配置*@paramtext文本内容*@paramvaluevolume*@paramvolumeRow读取速度*@returnsuccess*/publicstaticbooleantext(Stringtext,intvalue,intvolumeRow){try{//音频生成路径字符串路径="E:\tmp";//固定音量if(value<0||value>100){value=100;}//调用dll的读取方法ActiveXComponentax=newActiveXComponent("Sapi.SpVoice");//音量0-100ax.setProperty("音量",newVariant(value));//读取速度ax.setProperty("Rate",newVariant(volueRow));//输入语言内容Dispatchdispatch=ax.getObject();//执行朗读Dispatch.call(dispatch,"Speak",newVariant(text));//开始生成语音文件并构建文件流ax=newActiveXComponent("Sapi.SpFileStream");调度sfFileStream=ax.getObject();//设置文件生成格式ax=newActiveXComponent("Sapi.SpAudioFormat");调度文件格式=ax.getObject();//设置音频流格式Dispatch.put(fileFormat,"Type",newVariant(22));//设置文件输出流格式Dispatch.putRef(sfFileStream,"Format",fileFormat);//调用输出文件流open方法创建.wav文件Dispatch.call(sfFileStream,"Open",newVariant("E:\\tmp\\a.wav"),newVariant(3),newVariant(真的));//设置声音对应的输出流为输出文件对象Dispatch.putRef(dispatch,"AudioOutputStream",sfFileStream);//设置音量Dispatch.put(dispatch,"Volume",newVariant(value));//设置速度Dispatch.put(dispatch,"速率",新变体(volueRow));//执行读取Dispatch.call(dispatch,"Speak",newVariant(text));//关闭输出文件Dispatch.call(sfFileStream,"Close");Dispatch.putRef(dispatch,"AudioOutputStream",null);//关闭sfFileStream.safeRelease();文件格式.safeRelease();//关闭读取操作dispatch.safeRelease();ax.safeRelease();返回真;}catch(Exceptione){e.printStackTrace();}返回假;}问题:如果项目启动报错java.library.path中nojacob-1.18-x64,问题是jdk中缺少dll方法,需要下载一份到jdk的bin目录下的下载地址.com的:链接:https://pan.baidu.com/s/1B0_Z...提取码:mcru