Giter Club home page Giter Club logo

open_jtalk-docker's Introduction

open-jtalk-api

Open JTalkをWebAPIとして使用します。

コンテナー起動方法

以下のコマンドで、open-jtalk-apiコンテナーが起動して、WebAPIで待ち受けるようになります。

docker run -d -p 8080:8080 u6kapps/open-jtalk-api

使い方

とりあえずデフォルトのパラメータ値で音声データを取得するには、以下のように実行します。

curl -v -o hello.wav http://localhost:8080/voice?text=こんにちは

リクエスト・パラメータに指定できる項目は、Open JTalkのオプションにほぼ準拠しています(textだけ独自)。具体的には、以下のパラメータを指定できます。

パラメータ名 意味 省略時 設定範囲
text string voice text required
s integer sampling frequency auto 1--
p integer frame period (point) auto 1--
a float all-pass constant auto 0.0--1.0
b float postfiltering coefficient 0.0 0.0--1.0
r float speech speed rate 1.0 0.0--
fm float additional half-tone 0.0
u float voiced/unvoiced threshold 0.5 0.0--1.0
jm float weight of GV for spectrum 1.0 0.0--
jf float weight of GV for log F0 1.0 0.0--
g float volume (dB) 0.0
z integer audio buffer size (if i==0, turn off) 0 0--

パラメータを指定する場合は、例えば、以下のように実行します。

curl -v -o hello.wav http://localhost:8080/voice?text=こんにちは\&s=44000\&p=128\&a=0.5\&b=0.1\&r=1.5\&fm=0.1\&u=0.6\&jm=1.1\&jf=1.1\&g=60.0\&z=0

HTMLページに埋め込む場合は、以下のようにタグを記述します。

<audio src="http://localhost:58080/voice?text=こんにちは" controls></audio>

Dockerビルドの注意

m2/にローカルPCの~/.m2/の内容をコピーすると、Dockerビルドを高速化することができます。具体的には、Maven依存ライブラリのダウンロードを省略することで、ビルドを高速化します。

open_jtalk-docker's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.