オンライン、オフラインの色々な音声合成エンジンをサポートしているArnaud Rameyさんが開発したROSパッケージpicottsを紹介します。Raspberry Pi4 (RAM8GB)にUbuntu18.04をインストールして試しています。なお、残念ながら日本語は対応していません。
- picotts: A lightweight ROS package for Text-to-Speech generation by Arnaud Ramey
 
環 境
- Raspberry Pi4 (RAM 8GB)
 - Ubuntu 18.04.5 LTS
 - ROS Melodic
 
サポートしているエンジン
- オフライン:espeak, Festival, GNUstep, MaryTTS, pico2wave, speech_dispatcher
 - オンライン:AT&T, Google TTS, Ivona, Microsoft
 
インストール
- picottsの取得
$ cd ~/catkin_ws/src$ git clone https://github.com/arnaud-ramey/picotts.git
 -  各エンジン
-  MaryTTS(オフラインの中ではとてもクオリティが高い)
$ sudo apt install mplayer(mplayerは他のエンジンでも使うので必須)$ cd ~/src(~/srcがない場合はmkdir srcで作成してください)$ sudo apt install default-jre$ wget https://github.com/marytts/marytts/releases/download/v5.2/marytts-5.2.zip$ unzip marytts-5.2.zip$ cd marytts-5.2$ wget https://github.com/marytts/voice-upmc-pierre-hsmm/releases/download/v5.2/voice-upmc-pierre-hsmm-5.2.zip$ unzip voice-upmc-pierre-hsmm-5.2.zip
 - GNUstep
$ sudo apt install gnustep-gui-runtime
 - speech_dispatcher
$ sudo apt install speech-dispatcher
 
 -  MaryTTS(オフラインの中ではとてもクオリティが高い)
 - 必要なファイルのインストール
$ source ~/.bashrc$ rosdep install picotts --ignore-src
 - ビルド
$ cd ~/catkin_ws$ catkin build picotts
 - エラーが出る場合
- rosdepとビルドで以下のようなエラーが出る場合は、
- ERROR: Rosdep cannot find all required resources to answer your query
Missing resource picotts
ROS path [0]=/opt/ros/melodic/share/ros 
 - ERROR: Rosdep cannot find all required resources to answer your query
 - 次のコマンドを実行してビルドを再実行する。
$ sudo apt update$ sudo apt upgrade$ cd ~/catkin_ws$ rosdep install --from-paths src --ignore-src -r -y
 
 - rosdepとビルドで以下のようなエラーが出る場合は、
 
実 行
-  MaryTTSを使う場合は以下のコマンドによりローカルでサーバーと設定用のクライアントを起動する。
$ cd ~/src/marytts-5.2/bin$ ./marytts-server- 別の端末を開き、同じディレクトリにあるクライアントプログラムを起動する。
$ cd ~/src/marytts-5.2/bin$ ./marytts-client
 - もう一つ、別の端末を開き、次のコマンドを実行してROSマスターを起動する。
 $ roscore
 - 別の端末を開き、次のコマンドでpicottsを実行する。
$ rosrun picotts picotts.exe
 
テスト
- 別の端末を開き、次のコマンドを実行。音が聞こえたら成功!
$ rostopic pub /tts std_msgs/String "My name is Happy Robot"
 - エンジンの切り替え: 別の端末を開き、オフラインで使いたいときはMarryTTSがお勧め、ネットに接続しているときはMicroSoftの方がクオリティが高い。なお、標準ではpico2waveなのでクオリティが低い。
- MarryTTS (オフライン)
$ rostopic pub /picotts/engine std_msgs/String "MarryTTS"
 - Microsoft (オンライン)
$ rostopic pub /picotts/engine std_msgs/String "microsoft"
 
 - MarryTTS (オフライン)
 
トピック
- /tts [std_msgs/String] 発話される文字列
 - /picotts/engine [std_msgs/String] 使用されるエンジン。picottsノード実行中に変更可能
 
その他
- 詳細についてはArnaudさんのサイトをご覧ください。
- picotts: A lightweight ROS package for Text-to-Speech generation by Arnaud Ramey
 
 
ハンズオン
- エンジンをMicrosoftに変えて、次の文章を発話させてみよう。
- “Impossible is a word to be found only in the dictionary of fools.” - Napoleon Bonaparte
 
 - エンジンをMarryTTSに変えて、好きな英語の文章を発話させてみよう。
 - rostopic pubコマンドを使って”My name is Happy Robot”と発話させましたが、これをpythonプログラムで実装しよう。
 
以上
  
  
  
  


コメント