18
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UnityBoyomichanClient Unityから棒読みちゃんを操作するライブラリ

Posted at

UnityBoyomichanClient

Unityから棒読みちゃんを操作するライブラリを作ったので公開します。

MITライセンスです。

できること

  • テキスト読み上げ
  • 一時停止
  • 一時停止解除
  • 読み上げスキップ
  • 残りタスク全消去
  • 一時停止状態の取得
  • 残タスク取得
  • 読み上げ状態取得

使い方

Taskベースなため、.NET 4.xモード以降が利用可能なUnityでのみ動作します。

private async Task SpeechSample()
{
    // クライアント初期化
    var _boyomiClient = new BoyomichanClient("127.0.0.1", 50001);

    await _boyomiClient.TalkAsync(
        message: "これはサンプルです",
        speed: -1, // -1で棒読みちゃん側の設定
        volume: -1,// -1で棒読みちゃん側の設定
        pitch: -1, // -1で棒読みちゃん側の設定
        voiceType: VoiceType.DefaultVoice,
        cancellationToken: default(CancellationToken));

    // 読み上げが終わるのをまつ
    while (await _boyomiClient.CheckNowPlaying())
    {
        await Task.Delay(TimeSpan.FromSeconds(0.5f)); //0.5sごとに確認
    }

    Debug.Log("Done");
}
18
17
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?