本記事は作成中です。
HARD2021(Home AI Robot Development)スプリングワークショップ用です。今回は、オンライン、オフラインの色々な音声合成エンジンをサポートしているArnaud Rameyさんが開発したROSパッケージpicottsを紹介します。残念ながら日本語は対応していません。
- picotts: A lightweight ROS package for Text-to-Speech generation by Arnaud Ramey
サポートしているエンジン
- オフライン: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
- 各エンジン
- GNUstep
$ sudo apt install gnustep-gui-runtime
- speech_dispatcher
$ sudo apt install speech-dispatcher
- GNUstep
- 必要なファイルのインストール
$ source ~/.bashrc
$ rosdep install --from-paths src --ignore-src -r -y
- ビルド
$ cd ~/catkin_ws
$ catkin build picotts
実 行
- もう一つ、別の端末を開き、次のコマンドを実行してROSマスターを起動する。
$ roscore
- 別の端末を開き、次のコマンドでpicottsを実行する。
$ rosrun picotts picotts.exe
テスト
- 別の端末を開き、次のコマンドを実行。音が聞こえたら成功!
$ rostopic pub /tts std_msgs/String "My name is Happy Robot"
- エンジンの切り替え: 別の端末を開き、ネットに接続しているときはMicroSoftがクオリティが高いのでおすすめ。
- Microsoft (オンライン)
$ rostopic pub /picotts/engine std_msgs/String "microsoft"
- MarryTTS (オフライン)
$ rostopic pub /picotts/engine std_msgs/String "pico"
- Microsoft (オンライン)
トピック
- /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に変えて発話させてみよう。
Beneath it were the words. Stay Hungry. Stay Foolish. It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.
- rostopic pubコマンドを使って”My name is Happy Robot”と発話させましたが、これをpythonプログラムで実装しよう。
- オウム返しのpythonプログラムを作ろう。あなたの発話を音声認識エンジンで変換して、認識結果をトピック名/tts、メッセージ型std_msgs/Stringでパブリッシュします。次に、picottsノードを使い、その認識結果をコンピュータに発話させましょう。
以上