フランス語(SI_VOX)と英語(FreeTTS)のテキスト読み上げ

テキスト読み上げまたはテキスト読み上げ  (または TTS、テキスト読み上げ)は、テキストから人工音声を作成できる方法です。音声バージョンから beepsを生成する信号処理を含む、テキストの文字起こしには言語処理技術に依存しています. スティーブン・ホーキング博士  は、この手法を使用して他のユーザーと通信します。

1 - Text-to-speech in French (with SI_VOX)

SI_VOXはフランス語のライブラリであり、Javaでのフランス語のテキスト読み上げに最適なAPIです。これを使用するには、次の手順に従います
  1. SI_VOX APIのダウンロード: http://users.polytech.unice.fr/~helen/SI_VOX-SRC.tar.gz
  2. プロジェクトを作成したら、ライブラリ 'SI_VOX.jar' をプロジェクトにインポートします.
  3.  プロジェクトのルートにある圧縮フォルダーには、このファイルには voice.
  4. テキストを読み取るクラスをインポート:
インポートt2s.son.TextReader;
 5.  テキストリーダーを作成:
ReaderTextReader = new ReaderText("こんにちは");
 6.本文を読む: 
player.playAll();
 7.  テキストの編集: 
reader.setText("私はテキスト読み上げプログラムです」);

import t2s.son.TextReader;

public class Synthese_Vocale{
public static void main(String[] args) {
ReaderTextReader = new ReaderText("hello");
player.playAll();
reader.setText("私はスピーチシンセサイザーですが、あなたは誰ですか?");
player.playAll();
}
}

2- 英語のテキスト読み上げ(FreeTTSを使用)

FreeTSS esオープンソースのテキスト読み上げシステムであり、Java言語で作成されました。FreeTTSは、 ;の実装です。Java Speech API.


FreeTTS APIの詳細については、このリンクをクリックしてください http://freetts.sourceforge.net/docs/index.php#what_is_freetts

テキストを音声に変換するには、インターフェイスが必要です FreeTTSSpeakable テキストをFreeTTSSpeakableオブジェクトに変換します。

Voice: FreeTTS の中心点であり、FreeTTSSpeakable を入力として受け取り、関連するテキストを音声に変換し、対応する audio.

VoiceManager: FreeTTSの声の倉庫です。音声の選び方:
VoiceManager voiceManager = VoiceManager.getInstance();
// ボイスのリストを作成
Voice[] voice = voiceManager.getVoices();

//各音声にはプロパティがあり、必要に応じてリストを参照して音声を見つけることができます。
// この音声にリソースを割り当てる

voice [x].allocate();
次のコードはデモンストレーション アプリケーションです。シンセサイザー音声の使用を実演する FreeTTSの。このプログラムでは、FreeTTS "JSAPI" APIは不要

import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;

public class Synthese_Vocale {
/**
* すべてのボイスを表示する方法
*/
public static void voicelist() {
System.out.println("");
VoiceManager voiceManager = VoiceManager.getInstance();
Voice[] voice = voiceManager.getVoices();
for (int i = 0; i < voice.length; i++) {
System.out.println(" " + voice[i].getName()
+ " (" + voice[i].getDomain() + " domain)");
}
}

public static void main(String[] args) {

/*利用可能なすべての音声を表示できるようにするメソッド*/
voicelist();

文字列 VoiceName = "ケビン";
System.out.println("\n使用した音声: " + VoiceName);

/* VoiceManager は FreeTTS のすべてのボイスを管理します
*/
VoiceManager voiceManager = VoiceManager.getInstance();
/*音声
をロード */
Voice = voiceManager.getVoice(VoiceName);

/*ボイス名が存在しない場合は、error
*/
if (voice == null) {
System.err.println(
"ボイス "
+ voicename +".が認識されないので、別の名前を試してください。
System.exit(1);
}

/* ボイスが使用するリソースを読み込む
*/
voice.allocate();

/* 音声合成
*/
voice.speak("hello world");
voice.speak("今日はお元気ですか");
voice.speak("私はプログラマーです");

/* 割り当て解除
*/
voices.deallocate();
/*プログラムは正常に完了しました
*/
System.exit(0);
}
}
Advertisement

AdBlock Detected

Please disable your ad blocker and refresh the window to use this website.