Voice Javaweb speech Synthesis Solution

Source: Internet
Author: User
Tags docker run

Online speech synthesis

Turn text information into sound information and give your app a "mouth". We offer a wide selection of highly featured pronunciation people (sound library). Its synthetic sound in the tone, nature and other aspects of performance are close to or even more than the vocal. This TTS experience achieves a truly commercially available standard

The voice of the speech synthesis is still very bull p, not only the basic pronunciation of people, but also the quality of the pronunciation of people, characteristics of the pronunciation of people, the star pronunciation of people, of course, if you have special requirements can also be customized.

Here we choose the basic pronunciation of people do simple javaweb integration test, because other options to apply, think or forget, and so the process go through.

Platform Environment

JDK1.7, TOMCAT8, Eclipse, Flight JDK, win+ffmpeg (test), linux+docker+ffmpeg (production)

Description: True, win platform under FFmpeg installation use or is very easy, directly download the compression package without installation, Java directly invoke the execution of commands. Linux under a variety of dependent compilation can put your little machine to die, and also a variety of compilation errors, and then decisively use Docker, the only headache is that the environment is really clean, various commands do not support, of course, this is the advantage of Docker.

Flow chart

Web integration

Iflytek provides us with a simple SDK, the Iflytek MSC Development Guide-java. Of course, if you want to have a flying account, registration, create applications and so on here do not repeat, as long as the last can get to a app_id can.

Win+ffmpeg (Test)
    • Speech synthesis needs dynamic link library support, according to their own system to put Msc64.dll or Msc32.dll to the specified directory, you can use System.getproperty ("Java.library.path") to view, placed in any directory.

    • According to their own system to download the corresponding FFmpeg, decompression can, directly call the bin directory Ffmpeg.exe can be. -
Linux+docker+ffmpeg (production) Get ffmpeg image
docker pull jrottenberg/ffmpeg
Create and run the container
docker run -it --name app_ffmpeg -p 8080:8080 -v /home/app_ffmpeg/:/mnt/app/  --entrypoint=‘bash‘ jrottenberg/ffmpeg

Note: The various Yum, wget, and Vim are not present in the Docker container, so the majority configuration is obtained from the host machine and then synchronously copied into the container.

Installing the configuration JDK

Oracle to get the certification must be downloaded, here we download and manually uploaded to the/home/app_ffmpeg directory.

# 复制配置文件到宿机docker cp 4f131c866092:/etc/profile  /home/app_ffmpeg/

Edit Profile, append the following configuration

#set java environmentJAVA_HOME=/mnt/app/jdk1.7.0_80JRE_HOME=/mnt/app/jdk1.7.0_80/jreCLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libPATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binexport JAVA_HOME JRE_HOME CLASS_PATH PATH
# 复制配置文件到容器docker cp /home/app_ffmpeg/profile 4f131c866092:/etc/

Entry into the container, effective configuration

# 进入容器docker exec -it app_ffmpeg  bash# 使配置生效source /etc/profile# 检查JDK是否安装成功java -version
Installation configuration Tomcat

If the Tomcat boot card master does not move

Locate the Jdk1.x.x_xx/jre/lib/security/java.security file, find the Securerandom.source setting in the file, and change it to:

securerandom.source=file:/dev/./urandom

If the tomcat output is garbled in Chinese

localelocale -aLANG=C.UTF-8  (有的是zh_CN.UTF-8,不过我在本地没发现这种编码)source /etc/profile
Configure the news fly Dynamic Library

Depending on your system version, upload libmsc32.so or libmsc64.so to the/lib/and/lib64/directories, respectively.

Open Source Projects

Https://gitee.com/52itstyle/xufei_msc

Demo Address

http://xunfei.52itstyle.com/xufei_msc/

Voice Javaweb speech Synthesis Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.