uezo / ChatdollKit

ChatdollKit enables you to make your 3D model into a chatbot
Apache License 2.0
790 stars 79 forks source link

Error when using Google TTS Loader #352

Closed peltwwb closed 1 month ago

peltwwb commented 2 months ago

I am using version 0.8.1.

Upon attaching the Google TTS Loader, the system responds to the wake word; however, the “listening…” does not appear afterward.

The console shows the following error:

Error occurred while processing text-to-speech voice: Length of created clip must be larger than 0

In contrast, the OpenAI TTS Loader functions without any issues.

I would appreciate your help in resolving this issue.

uezo commented 2 months ago

Hi @peltwwb ,

That message shows that Google TTS service got no texts to speech. You can debug by inserting the following block:

        protected override async UniTask<AudioClip> DownloadAudioClipAsync(Voice voice, CancellationToken token)
        {
            if (token.IsCancellationRequested) { return null; };

            if (string.IsNullOrEmpty(ApiKey) || string.IsNullOrEmpty(Language))
            {
                Debug.LogError("API Key or Language are missing from GoogleTTSLoader");
            }

            // Insert this block
            if (string.IsNullOrEmpty(voice.Text.Trim()))
            {
                Debug.Log($"No texts to speak");
                return null;
            }
peltwwb commented 2 months ago

Thank you! The problem has been solved!

uezo commented 2 months ago

@peltwwb 👍

I will update some TTSLoaders that have same issue.