RageAgainstThePixel / com.rest.elevenlabs

A non-official Eleven Labs voice synthesis client for Unity (UPM)
https://elevenlabs.io/?from=partnerbrown9849
MIT License
74 stars 9 forks source link

Generated audio is broken, even on the website. #45

Closed amrynader closed 9 months ago

amrynader commented 9 months ago

I wrote a simple script to test this and what happens is it's 'generated' but there is no audio. If you check the history on the Elevenlabs website you will find a new entry with the details of your request (voice, text, etc.) but it doesn't play, it's broken.

       audioSource = gameObject.AddComponent<AudioSource>();

       var api = new ElevenLabsClient(KEY);
       var text = "This is a test.";

       var voice = await api.VoicesEndpoint.GetVoiceAsync("Xdh3log2I8HaZbsvAYlt");

       var partialClips = new Queue<AudioClip>();

       var voiceClip = await api.TextToSpeechEndpoint.StreamTextToSpeechAsync(
           text,
           voice,
           partialClip =>
           {
               // Note: Best to queue them and play them in update loop!
               // See TextToSpeech sample demo for details
               partialClips.Enqueue(partialClip);
           });
       // The full completed clip:

       audioSource.clip = voiceClip.AudioClip;

       audioSource.Play();

Upon further testing, it appears that the issue arises from specifying a certain voice.

StephenHodgson commented 9 months ago

Did you try the sample scene?

amrynader commented 9 months ago

Did you try the sample scene?

I did, I did more tests and I realized that it's localized within the GetVoiceAsync() function

StephenHodgson commented 9 months ago

It's worth pointing out that streaming in unity uses the PCM format, and since the history is missing critical metadata, it's near impossible to recreate and playback even in website.

See #35

StephenHodgson commented 9 months ago

As for why you didn't get any generated audio, I'm unsure as the sample scene should work. If it doesn't, check the voice option, or try a different one. If it still doesn't payback, check your system audio settings.

StephenHodgson commented 9 months ago

Id you need additional troubleshooting assistance join my discord server