【离线文本转语音文件】java spring boot jacob实现文字转语音文件,离线文本转化语音,中英文生成语音,文字朗读,中文生成声音,文字生成声音文件,文字转语音文件,文字变声音。

2023-11-08

1.实现效果如下:

输入文字(支持中英文),点击转换生成***.wav文件,点击下载到本地就可。

 生成后的音频文件播放,时长1分8秒

2.实现代码:

         这次采用jacob实现,相比百度AI需要联网,本项目定位内网环境实现。所以最终采jacob。

1.环境配置:

本次采用版本jacob-1.19,我们需要下载jacob.jar和dll

下载地址:jacob语音生成文件,jacobx64.dll和jacob.jar为1.9-Java文档类资源-CSDN下载

官网地址:JACOB - Java COM Bridge download | SourceForge.net

下载后得到两个文件:

jacob.dll:配置到jdk环境中

jacob.jar:放入到项目中并配置下pox和Idea 的dependencies下

第一步

jacob.dll放入:C:\Program Files\Java\jdk1.8.0_121\jre\bin

 第二步:

        1.首先有一个spring boot项目,没有就搭建一个

        2.把jacob放到项目resources>lib目录下

         3.在pom.xml文件添加依赖:

 <!--添加本地的jacob.jar包-->
        <dependency>
            <groupId>com.jacob</groupId>
            <artifactId>jacob</artifactId>
            <version>1.19</version>
            <!--system使用本地jar包-->
            <scope>system</scope>
            <systemPath>${basedir}/src/main/resources/lib/jacob.jar</systemPath>
        </dependency>

4.在idea下的项目中添加依赖包,

 5.这样环境就搭建完成。

2.编码:

核心代码,这样就可以输入文字,生成音频文件保存到本地目录中,然后下载音频文件就只需要读取文件就可以。

 //输入文本内容,生成文件地址 text为输入的文本信息
    public void audioFile(String text){
        try {
            
            //jacob.dll没成功安装,执行这一步会出错
            //构建音频格式 调用注册表应用
            Dispatch spAudioFormat = new ActiveXComponent("Sapi.SpAudioFormat").getObject();
            //音频文件输出流
            Dispatch spFileStream = new ActiveXComponent("Sapi.SpFileStream").getObject();
            //构建音频对象
            Dispatch spVoice =  new ActiveXComponent("Sapi.SpVoice").getObject();

            //设置spAudioFormat音频流格式类型22
            Dispatch.put(spAudioFormat, "Type", new Variant(22));
            //设置spFileStream文件输出流的音频格式
            Dispatch.putRef(spFileStream, "Format", spAudioFormat);
            
            //设置spFileStream文件输出流参数地址等 
            Dispatch.call(spFileStream, "Open", new Variant("D:\speech\48641486.wav"), new Variant(3), new Variant(true));
            //设置spVoice声音对象的音频输出流为输出文件对象
            Dispatch.putRef(spVoice, "AudioOutputStream", spFileStream);
            //设置spVoice声音对象的音量大小100
            Dispatch.put(spVoice, "Volume", new Variant(100));
            //设置spVoice声音对象的速度 0为正常速度,范围【..-2 -1 0 1 2..】
            Dispatch.put(spVoice, "Rate", new Variant(0));
            //设置spVoice声音对象中的文本内容
            Dispatch.call(spVoice, "Speak", new Variant(text));
            //关闭spFileStream输出文件
            Dispatch.call(spFileStream, "Close");

            //释放资源
            spVoice.safeRelease();
            spAudioFormat.safeRelease();
            spFileStream.safeRelease();

        }catch (Exception e){
            System.out.println(e.getMessage());
        }
       
    }

3.其他业务代码:非核心

下面就贴上完整的项目代码和配置文件

1.项目结构:

 主要就几个文件:HomeController、TextToSpeechFileService、index.html、pom.xml

2.pom.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>text_speech</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>text_speech</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.5.0</spring-boot.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <!--添加本地的jacob.jar包-->
        <dependency>
            <groupId>com.jacob</groupId>
            <artifactId>jacob</artifactId>
            <version>1.19</version>
            <!--system使用本地jar包-->
            <scope>system</scope>
            <systemPath>${basedir}/src/main/resources/lib/jacob.jar</systemPath>
        </dependency>


    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.5.0</version>
                <configuration>
                    <mainClass>com.example.text_speech.TextSpeechApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

3.index.xml

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>文字转语音</title>
    <link rel="shortcut icon" href="https://pic.onlinewebfonts.com/svg/img_196224.png">
    <link th:href="@{/plugins/layui/src/css/layui.css}" type="text/css" rel="stylesheet"/>
    <script th:inline="javascript">
        let ctx = /*[[@{/}]]*/ '';
    </script>
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 80px;">
        <legend>文字转音频文件</legend>
    </fieldset>

    <div class="layui-bg-gray" style="padding: 30px;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <!--一行内容块-->
                <div class="layui-form-item layui-form-text layui-panel"  >
                    <textarea placeholder="请输入内容,支持中英文字。" id="textContent" class="layui-textarea" style="height: 400px"></textarea>
                </div>
            </div>
            <div class="layui-col-md6 ">
                <div class="layui-form-item "style="width: 100px">
                    <button  style="margin-top: 100px;" class="layui-btn" onclick="getAudioFile()" >生成音频文件</button>
                </div>

                <div class="layui-panel" style="width: 400px;margin-left: 200px;top: -50px;height: 200px" >
                    <div id="noFile" style="margin: 20px">
                        等待生成文件。
                    </div>
                    <div id="existFile" hidden>
                        <h3 style="text-align: center">音频文件已经生成</h3>
                        <div style="margin: 20px" >
                            <div>文件名称:<span id="fileName"></span></div>
                            <div>文件格式:<span id="fileFormat"></span></div>
                            <div>创建时间:<span id="fileDate"></span></div>
                        </div>
                        <button  style="margin: 20px;margin-left: 35%" class="layui-btn" onclick="downFile()">下载文件</button>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script th:src="@{/plugins/jquery/jquery-1.12.0.min.js}" type="text/javascript"></script>
<script th:src="@{/plugins/layui/src/layui.js}" type="text/javascript"></script>
<script type="text/javascript">

    /*文字转换*/
    function getAudioFile(){
        let loading = layer.load('Loading...', {
            shade: [0]
        });
        let text = $("#textContent").val();
        $.post("./tts",{"textContent":text},function (data) {
            layer.close(loading);
            if (data.code==="1"){
                $("#existFile").show();
                $("#noFile").hide();
                $("#fileName").html(data.name);
                $("#fileFormat").html(data.format);
                $("#fileDate").html(data.date);
            }else {
                $("#existFile").hide();
                $("#noFile").show();
                $("#noFile").html("文件生成发生错误。请检查输入内容。保证只有标准的标点符号和文字。");
            }
        })
    }

    /*下载文件*/
    function downFile(){
        window.open("./downFile?fileName="+$("#fileName").html(), "_blank");
    }

</script>
</html>

3.HomeController 

package com.example.text_speech.controller;

import com.example.text_speech.service.TextSpeechService;
import com.example.text_speech.service.TextToSpeechFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;


@Controller
public class HomeController {
    
    @Autowired
    private TextToSpeechFileService textToSpeechFileService;
    


    /***
     * @Author: LiaoJJ
     * @Description:主页
     */
    @RequestMapping({"/index","/",""})
    public ModelAndView index(){
        return new ModelAndView("index");
    }


    /***
     * @Author: admin
     * @Description: 文本转语音
     */
    @RequestMapping("/tts")
    @ResponseBody
    public HashMap<String,String> textTransformAudio(String textContent){
       return textToSpeechFileService.audioFile(textContent);
    }

    /***
     * @Author: admin
     * @Description: 下载文件
     */
    @RequestMapping("/downFile")
    @ResponseBody
    public void down(String fileName, HttpServletResponse response){
        textToSpeechFileService.down(fileName,response);
    }


}

 4.TextToSpeechFileService

package com.example.text_speech.service;

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.UUID;

/***
 * @Author: LiaoJJ
 * @Date: 2022/10/12
 * @Description:文字转语音文件
 */
@Service
@ComponentScan
public class TextToSpeechFileService {

    //语音文件生成的临时文件
    @Value("${filePath}")
    private String path;

    //输入文本内容,生成文件地址
    public HashMap<String,String> audioFile(String text){
        HashMap<String , String> map = new HashMap<>();
        try {
            //构建音频格式 调用注册表应用
            Dispatch spAudioFormat = new ActiveXComponent("Sapi.SpAudioFormat").getObject();
            //音频文件输出流
            Dispatch spFileStream = new ActiveXComponent("Sapi.SpFileStream").getObject();
            //构建音频对象
            Dispatch spVoice =  new ActiveXComponent("Sapi.SpVoice").getObject();

            //设置spAudioFormat音频流格式类型22
            Dispatch.put(spAudioFormat, "Type", new Variant(22));
            //设置spFileStream文件输出流的音频格式
            Dispatch.putRef(spFileStream, "Format", spAudioFormat);
            //随机uuid
            String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
            String filePath = path + uuid + ".wav";
            //设置spFileStream文件输出流参数地址等
            Dispatch.call(spFileStream, "Open", new Variant(filePath), new Variant(3), new Variant(true));
            //设置spVoice声音对象的音频输出流为输出文件对象
            Dispatch.putRef(spVoice, "AudioOutputStream", spFileStream);
            //设置spVoice声音对象的音量大小100
            Dispatch.put(spVoice, "Volume", new Variant(100));
            //设置spVoice声音对象的速度 0为正常速度,范围【..-2 -1 0 1 2..】
            Dispatch.put(spVoice, "Rate", new Variant(0));
            //设置spVoice声音对象中的文本内容
            Dispatch.call(spVoice, "Speak", new Variant(text));
            //关闭spFileStream输出文件
            Dispatch.call(spFileStream, "Close");

            //释放资源
            spVoice.safeRelease();
            spAudioFormat.safeRelease();
            spFileStream.safeRelease();

            map.put("code","1");
            map.put("name",uuid + ".wav");
            map.put("format","wav");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            map.put("date",sdf.format(new Date()));
        }catch (Exception e){
            System.out.println(e.getMessage());
            map.put("code","0");
        }
        return map;
    }

    /***
     * @Author: LiaoJJ
     * @Description: 下载文件
     */
    public void down(String fileName, HttpServletResponse response) {
        try {
            response.reset();
            response.setCharacterEncoding("UTF-8");
            response.setContentType("application/octet-stream");
            //3.设置content-disposition响应头控制浏览器以下载的形式打开文件
            response.addHeader("Content-Disposition","attachment;filename=" + new String(fileName.getBytes(),"utf-8"));
            //获取文件输入流
            InputStream in = new FileInputStream(path+fileName);
            int len = 0;
            byte[] buffer = new byte[1024];
            OutputStream out = response.getOutputStream();
            while ((len = in.read(buffer)) > 0) {
                //将缓冲区的数据输出到客户端浏览器
                out.write(buffer,0,len);
            }
            in.close();
        }catch (Exception e){
            e.getMessage();
            System.out.println("文件下载失败");
        }
    }

}

5.application.yml

# 应用名称
spring:
  application:
    name: text_speech
  devtools:
    restart:
      enabled: true
      additional-paths: resources/**,static/**,templates/**
  thymeleaf:
    prefix: classpath:/templates/
    suffix: .html
    cache: false  # 开启模板缓存
    encoding: UTF-8
    servlet:
      content-type: text/html
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
  resources:
    add-mappings: true
    #静态资源访问路径
    static-locations: classpath:/static,classpath:/templates/,file:${config.file.root}

# 应用服务 WEB 访问端口
server:
  port: 8080

#配置本地临时文件夹
filePath: D:\speech\

通过上面的几个文件代码,就可以实现文章前面web页面的效果了。

本文章只是一个demo演示。应用到具体业务中还需要做一些修改。

如果其中存在什么问题回复到评论区,及时修改。感谢阅览。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【离线文本转语音文件】java spring boot jacob实现文字转语音文件,离线文本转化语音,中英文生成语音,文字朗读,中文生成声音,文字生成声音文件,文字转语音文件,文字变声音。 的相关文章

  • Math.random() 解释

    这是一个非常简单的 Java 尽管可能适用于所有编程 问题 Math random 返回 0 到 1 之间的数字 如果我想返回零到百之间的整数 我会这样做 int Math floor Math random 101 在一到一百之间 我会这
  • 如何修复安装 maven jar 插件依赖项时出现的错误?

    我正在将应用程序制作成 maven 中的 jar 文件 但是 当我从 Maven 中提取 jar 插件存储库并在终端中运行这三个命令时 mvn clean mvn compile mvn package 在 mvn package 中 我收
  • 将倒计时器从 10 秒改为 1 秒

    我有一个倒计时器 它以 1 秒的增量从 10000 毫秒倒计时到 0 毫秒 以使按钮在 10 秒后可单击 尽管计时器是准确的并且按照代码的说明执行操作 但我想更改秒的表示方式 但我不知道如何更改 java void startTimer c
  • Java 8 中异常类型推断的一个独特功能

    在为该网站上的另一个答案编写代码时 我遇到了这个特性 static void testSneaky final Exception e new Exception sneakyThrow e no problems here nonSnea
  • Java JNDI 名称 java:/

    我正在遵循教程 https docs oracle com javase tutorial jndi index html https docs oracle com javase tutorial jndi index html 我的冒险
  • android.os.FileUriExposedException 在 Oreo 中引起(仅!)[重复]

    这个问题在这里已经有答案了 从 Google Play Console 中 我可以看到此异常仅发生在 Android 8 0 的设备上 android os FileUriExposedException at android os Str
  • Logback 配置在单行上有异常吗?

    我的日志被提取 传输并合并到 elasticsearch 中 多行事件很难跟踪和诊断 有没有办法使用收集器和正则表达式将异常行分组到单个记录中登录配置 https logback qos ch manual layouts html xTh
  • 外部化 Spring Security 配置?

    我有一个 Web 应用程序 可以使用 Spring Security 的几种不同配置 但是 这些差异配置都是在我的 applicationContext 配置文件中设置的 因此 为了在客户站点调整这些内容 必须在 WAR 文件内修改这些内容
  • Poi:从 xlsm 打开 Excel 文件后将其保存为 xlsx

    我正在编写一个java程序 它打开一个用户定义的excel文件 用数据填充它 然后将其保存在用户指定的路径 文件名和扩展名下 即使输入文件是 xlsm 也应该可以声明输出保存为 xlsx 但实际上是不可能的 如果我尝试使用下面的代码 打开文
  • 最终类中的静态函数是否隐式最终?

    我的问题基本上与this https stackoverflow com q 8766476 3882565一 但这是否也适用于static功能 我想了解 编译器是否处理所有static函数在一个final类为final 是否添加final
  • 使用嵌入式 Jetty 7 发布 JAX-WS 端点

    有人可以帮忙吗 我想使用嵌入式 Jetty 7 作为端点 这是我尝试过的 public class MiniTestJetty WebService targetNamespace http public static class Calc
  • 检查对象是否为空

    我有一个链表 其中第一个节点包含空对象 表示firstNode data等于null firstNode nextPointer null firstNode previousPointer null 我想检查firstNode 是否为空
  • 如何保存/加载 BigInteger 数组

    我想保存 加载BigInteger数组传入 传出 SharedPreferences 如何做呢 例如对于以下数组 private BigInteger dataCreatedTimes new BigInteger 20 Using Gso
  • Java如何区分这些具有相同名称/签名的多个方法?

    今天我在追踪一个错误 我注意到我们的一个班级中有一些奇怪的事情 我删除了尽可能多的代码并发布在这里 class A static int obtainNumber return 42 static int obtainNumber retu
  • java中从视频中提取图像

    我想知道如何使用 JMF 从视频中提取图像 Player player Manager createRealizedPlayer cdi getLocator player start FrameGrabbingControl frameG
  • Maven编译错误:包不存在

    我正在尝试向现有企业项目添加 Maven 支持 这是一个多模块项目 前 2 个模块编译和打包没有问题 但我面临编译错误 我尝试在多个模块中使用相同的依赖项 我的结构是 gt parent gt pom xml gt module 1 gt
  • FocusEvent 没有获取 JFormattedTextField 的最后一个值,我如何获取它?

    我有两个JFormattedTextField我的物体JFrame目的 我想要通过这些值进行基本数学 加法 JFormattedTextField对象 我希望当焦点丢失第一个或第二个文本字段时发生这种情况 但当 focusLost 事件没有
  • Android 中的自定义相机应用程序问题 - 旋转 270、拉伸捕获视图且未获取所有功能

    我从代码中得到了帮助https github com josnidhin Android Camera Example https github com josnidhin Android Camera Example 但面临一些问题 例如
  • 如何为用户的活动设置计时器?

    如果用户在 5 小时内停止工作 我需要执行特定的方法 假设用户已登录 但他在 5 小时内没有向数据库的特定表添加任何记录 任何时候用户将记录添加到指定的表中 该特定用户的计时器都应该重置 否则它将继续运行 如果达到 5 小时 应用程序应显示
  • 最新版本 6.* Struts2 支持 Tomcat 10 吗? [复制]

    这个问题在这里已经有答案了 最新版本 6 Struts2 支持 Tomcat 10 吗 异常启动过滤器 struts2 java lang ClassCastException class org apache struts2 dispat

随机推荐

  • C++笔记——std::min_element和std::max_element

    https blog csdn net breeze5428 article details 25918925 参考网页 http en cppreference com w cpp algorithm min element 主要有两种用
  • LangChain 手记 Conclusion结语

    整理并翻译自DeepLearning AI LangChain的官方课程 Conclusion Conclusion 结语 本系列短课展示了大量使用LangChain构建的大语言模型应用 包括处理用户反馈 文档上的问答系统甚至使用LLM来决
  • 艾伦·麦席森·图灵——如谜的解谜者

    艾伦 麦席森 图灵 Alan Mathison Turing 1912年6月23日 1954年6月7日 英国数学家 逻辑学家 被称为计算机科学之父 人工智能之父 科学美国人 这样评价图灵性情矛盾的一生 个人生活隐秘又喜欢大众读物和公共广播
  • Android 刘海屏全屏适配(沉溺式状态栏,隐藏状态栏)

    RequiresApi Build VERSION CODES LOLLIPOP override fun onCreate savedInstanceState Bundle super onCreate savedInstanceSta
  • 01-----Ubuntu16.04安装Gnome桌面环境

    从这篇起 我将使用Ubuntu16 04来搭建流媒体开发的环境 这是Ubuntu16 04空虚拟机的开始文章虚拟机下配置linux的网络上网 包括ssh gcc g 的安装 几乎所有软件的搭建都是从零开始 上面安装好能上网后 本篇将讲述关于
  • E: Sub-process /usr/bin/dpkg returned an error code (1)

    执行命令 apt update apt dist upgrade apt update apt dist upgrade 是由于apt get安装软件时出现了类似于 注意 根据搜索得知 var lib dpkg info下保存有各个软件包的
  • 2022年前端面试题整理,持续更新中

    端面试题整理 已同步到掘金 CSDN 掘金地址 https juejin cn post 7075332630417244173 CSDN 地址 https blog csdn net z1832729975 article details
  • 一种3D视频格式转换(H264 MVC至SBS / OU)方案

    本文尚处于草稿状态 提前公开仅供预览 前言 两年前我就想写这个话题的文章 但一直拖延到现在 因为我在等待SkyBox VR Player支持3D MVC 我在想 如果3D播放器已经支持播放3D MVC格式 那么MVC至SBS转换就没有必要
  • spring中配置DButil数据源

    1 pom引入
  • web服务器群集-Nginx

    关于Nginx 一款高性能 轻量级Web服务软件 系统资源能耗低 对HTTP并发连接的处理能力高 单台物理服务器可支持3000 5000个并发请求 1 Nginx编译安装 安装支持软件 yum y install pcre devel zl
  • Maven打包时出现Process terminated错误

    Maven打包时出现Process terminated错误 检查maven的配置文件 多引入了一次控制器 编码错误 切点表达式错误 用maven打包时出现Process terminated样式的错误 报错如下 查看报错信息 检查mave
  • HDS 多路径软件HDLM for AIX安装及配置—精简范例篇

    HDS 多路径软件HDLM for AIX安装及配置 精简范例篇 aix 6 HDS VSP HDLM DLManager mpio rte HDLM Hitachi Dynamic Link Manager 是HDS公司提供的安装在主机端
  • Spring Data JPA学习笔记

    文章目录 Spring Data JPA 环境搭建 基本CRUD 分页 排序 基于规则自定义方法 基于Query注解方法 Spring Data JPA JPA字面意思是JAVA持久层API JPA定义了一系列标准 建立了实体类和数据库中表
  • CentOS7安装使用中文字符集的方法(转)

    通常安装Linux系统本着最简化安装 会默认使用英文字符集 不会安装中文字符集等其他字符 但是在一些必要情况下需要中文的支持 本文将以CentOS7为例演示下如何安装中文字符集 1 首先使用locale命令看看当前系统所使用的字符集 如图可
  • C语言 合并有序数组

    将2个已知有序的数组合并为一个新的有序数组 已有两个数组 arr1 和 arr2 要求将两个数组中元素合并到数组 arr3 中 合并时要去除数组中的重复数据 include
  • NLP学习(十四)-NLP实战之文本分类-中文垃圾邮件分类-Python3

    一 文本分类实现步骤 定义阶段 定义数据以及分类体系 具体分为哪些类别 需要哪些数据 数据预处理 对文档做分词 去停用词等准备工作 数据提取特征 对文档矩阵进行降维 提取训练集中最有用的特征 模型训练阶段 选择具体的分类模型以及算法 训练出
  • requests爬取网易云音乐

    访问网易云音乐 查找搜索接口的信息 发现搜索的接口没有想要的信息 我又去找其他接口 最后发现信息在这里 而且请求的接口是post的请求头 我换了种方式爬取 用selnium的方式 最后的成果是这样的 不打了 手累 不懂得可以问我 impor
  • 设置激光驱动器电流

    激光二极管在驱动电流过大的情况下较容易损坏 所以在调整激光驱动电路时 用测试负载来代替激光二极管 测试负载与激光二极管类似 但不像激光二极管会被过量的电流损坏 当我们将驱动电流设置到合适之后 测试负载便可以用激光二极管代替 测试负载 测试负
  • Unity3D 旋转天空盒的方法

    天空盒是不能旋转的 但我们可以旋转摄像机来达到天空盒的旋转效果 实现方法如下 1 我们创建一个摄像机名为Skybox Camera 2 主摄像机Main Camera的Clear Flags设置为Don t Clear 3 Skybox C
  • 【离线文本转语音文件】java spring boot jacob实现文字转语音文件,离线文本转化语音,中英文生成语音,文字朗读,中文生成声音,文字生成声音文件,文字转语音文件,文字变声音。

    1 实现效果如下 输入文字 支持中英文 点击转换生成 wav文件 点击下载到本地就可 生成后的音频文件播放 时长1分8秒 2 实现代码 这次采用jacob实现 相比百度AI需要联网 本项目定位内网环境实现 所以最终采jacob 1 环境配置