Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
amrynader opened this issue Nov 20, 2023 · 5 comments
Closed

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

amrynader opened this issue Nov 20, 2023 · 5 comments
Labels

Comments

@amrynader
Copy link

amrynader commented Nov 20, 2023

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.

@amrynader amrynader added the bug Something isn't working label Nov 20, 2023
@StephenHodgson
Copy link
Member

Did you try the sample scene?

@StephenHodgson StephenHodgson added triage and removed bug Something isn't working labels Nov 20, 2023
@amrynader
Copy link
Author

Did you try the sample scene?

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

@StephenHodgson
Copy link
Member

StephenHodgson commented Nov 20, 2023

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
Copy link
Member

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
Copy link
Member

StephenHodgson commented Nov 20, 2023

Id you need additional troubleshooting assistance join my discord server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants