Git Product home page Git Product logo

com.rest.elevenlabs's Introduction

com.rest.elevenlabs

Discord openupm openupm

A non-official ElevenLabs voice synthesis RESTful client for the Unity Game Engine.

Based on ElevenLabs-DotNet

I am not affiliated with ElevenLabs and an account with api access is required.

All copyrights, trademarks, logos, and assets are the property of their respective owners.

Installing

Requires Unity 2021.3 LTS or higher.

The recommended installation method is though the unity package manager and OpenUPM.

Via Unity Package Manager and OpenUPM

  • Open your Unity project settings
  • Select the Package Manager scoped-registries
  • Add the OpenUPM package registry:
    • Name: OpenUPM
    • URL: https://package.openupm.com
    • Scope(s):
      • com.rest.elevenlabs
      • com.utilities
  • Open the Unity Package Manager window
  • Change the Registry from Unity to My Registries
  • Add the ElevenLabs package

Via Unity Package Manager and Git url


Documentation

Table of Contents

Authentication

There are 4 ways to provide your API keys, in order of precedence:

⚠️ We recommended using the environment variables to load the API key instead of having it hard coded in your source. It is not recommended use this method in production, but only for accepting user credentials, local testing and quick start scenarios.

  1. Pass keys directly with constructor ⚠️
  2. Unity Scriptable Object ⚠️
  3. Load key from configuration file
  4. Use System Environment Variables

Pass keys directly with constructor

var api = new ElevenLabsClient("yourApiKey");

Or create a ElevenLabsAuthentication object manually

var api = new ElevenLabsClient(new ElevenLabsAuthentication("yourApiKey"));

Unity Scriptable Object

You can save the key directly into a scriptable object that is located in the Assets/Resources folder.

You can create a new one by using the context menu of the project pane and creating a new ElevenLabsConfiguration scriptable object.

Create new ElevenLabsConfiguration

Load key from configuration file

Attempts to load api keys from a configuration file, by default .elevenlabs in the current directory, optionally traversing up the directory tree or in the user's home directory.

To create a configuration file, create a new text file named .elevenlabs and containing the line:

Json format
{
  "apiKey": "yourApiKey",
}

You can also load the file directly with known path by calling a static method in Authentication:

var api = new ElevenLabsClient(new ElevenLabsAuthentication().LoadFromDirectory("your/path/to/.elevenlabs"));;

Use System Environment Variables

Use your system's environment variables specify an api key to use.

  • Use ELEVEN_LABS_API_KEY for your api key.
var api = new ElevenLabsClient(new ElevenLabsAuthentication().LoadFromEnvironment());

NuGet version (ElevenLabs-DotNet-Proxy)

Using either the ElevenLabs-DotNet or com.rest.elevenlabs packages directly in your front-end app may expose your API keys and other sensitive information. To mitigate this risk, it is recommended to set up an intermediate API that makes requests to ElevenLabs on behalf of your front-end app. This library can be utilized for both front-end and intermediary host configurations, ensuring secure communication with the ElevenLabs API.

Front End Example

In the front end example, you will need to securely authenticate your users using your preferred OAuth provider. Once the user is authenticated, exchange your custom auth token with your API key on the backend.

Follow these steps:

  1. Setup a new project using either the ElevenLabs-DotNet or com.rest.elevenlabs packages.
  2. Authenticate users with your OAuth provider.
  3. After successful authentication, create a new ElevenLabsAuthentication object and pass in the custom token.
  4. Create a new ElevenLabsSettings object and specify the domain where your intermediate API is located.
  5. Pass your new auth and settings objects to the ElevenLabsClient constructor when you create the client instance.

Here's an example of how to set up the front end:

var authToken = await LoginAsync();
var auth = new ElevenLabsAuthentication(authToken);
var settings = new ElevenLabsSettings(domain: "api.your-custom-domain.com");
var api = new ElevenLabsClient(auth, settings);

This setup allows your front end application to securely communicate with your backend that will be using the ElevenLabs-DotNet-Proxy, which then forwards requests to the ElevenLabs API. This ensures that your ElevenLabs API keys and other sensitive information remain secure throughout the process.

Back End Example

In this example, we demonstrate how to set up and use ElevenLabsProxyStartup in a new ASP.NET Core web app. The proxy server will handle authentication and forward requests to the ElevenLabs API, ensuring that your API keys and other sensitive information remain secure.

  1. Create a new ASP.NET Core minimal web API project.
  2. Add the ElevenLabs-DotNet nuget package to your project.
    • Powershell install: Install-Package ElevenLabs-DotNet-Proxy
    • Manually editing .csproj: <PackageReference Include="ElevenLabs-DotNet-Proxy" />
  3. Create a new class that inherits from AbstractAuthenticationFilter and override the ValidateAuthentication method. This will implement the IAuthenticationFilter that you will use to check user session token against your internal server.
  4. In Program.cs, create a new proxy web application by calling ElevenLabsProxyStartup.CreateDefaultHost method, passing your custom AuthenticationFilter as a type argument.
  5. Create ElevenLabsAuthentication and ElevenLabsClientSettings as you would normally with your API keys, org id, or Azure settings.
public partial class Program
{
    private class AuthenticationFilter : AbstractAuthenticationFilter
    {
        public override void ValidateAuthentication(IHeaderDictionary request)
        {
            // You will need to implement your own class to properly test
            // custom issued tokens you've setup for your end users.
            if (!request["xi-api-key"].ToString().Contains(userToken))
            {
                throw new AuthenticationException("User is not authorized");
            }
        }
    }

    public static void Main(string[] args)
    {
        var client = new ElevenLabsClient();
        var proxy = ElevenLabsProxyStartup.CreateDefaultHost<AuthenticationFilter>(args, client);
        proxy.Run();
    }
}

Once you have set up your proxy server, your end users can now make authenticated requests to your proxy api instead of directly to the ElevenLabs API. The proxy server will handle authentication and forward requests to the ElevenLabs API, ensuring that your API keys and other sensitive information remain secure.

Editor Dashboard

You can perform all of the same actions from the ElevenLabs website, in the Editor using the ElevenLabs Dashboard!

Window/Dashboards/ElevenLabs

dashboard

Speech Synthesis Dashboard

Just like in the ElevenLabs website, you can synthesize new audio clips using available voices. This tool makes it even more handy as the clips are automatically downloaded and imported into your project, ready for you to use!

Speech Synthesis

Voice Lab Dashboard

Just like in the ElevenLabs website, you can manage all your voices directly in the editor.

Voice Lab

Voice Designer Dashboard

Selecting Create New Voice will display a popup where you can design entirely new voices using ElevenLabs generative models.

Voice Designer

Voice Cloning Dashboard

Additionally, you're also able to clone a voice from sample recordings.

Voice Cloning

History Dashboard

You also have access to the full list of all your generated samples, ready for download.

History

Convert text to speech.

var api = new ElevenLabsClient();
var text = "The quick brown fox jumps over the lazy dog.";
var voice = (await api.VoicesEndpoint.GetAllVoicesAsync()).FirstOrDefault();
var defaultVoiceSettings = await api.VoicesEndpoint.GetDefaultVoiceSettingsAsync();
var voiceClip = await api.TextToSpeechEndpoint.TextToSpeechAsync(text, voice, defaultVoiceSettings);
audioSource.PlayOneShot(voiceClip.AudioClip);

Note: if you want to save the voice clip into your project, you will need to copy it from the cached path into the specified location in your project:

voiceClip.CopyIntoProject(editorDownloadDirectory);

Stream text to speech.

var api = new ElevenLabsClient();
var text = "The quick brown fox jumps over the lazy dog.";
var voice = (await api.VoicesEndpoint.GetAllVoicesAsync()).FirstOrDefault();
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;

Access to voices created either by the user or ElevenLabs.

Get All Voices

Gets a list of all available voices.

var api = new ElevenLabsClient();
var allVoices = await api.VoicesEndpoint.GetAllVoicesAsync();

foreach (var voice in allVoices)
{
    Debug.Log($"{voice.Id} | {voice.Name} | similarity boost: {voice.Settings?.SimilarityBoost} | stability: {voice.Settings?.Stability}");
}

Get Default Voice Settings

Gets the global default voice settings.

var api = new ElevenLabsClient();
var result = await api.VoicesEndpoint.GetDefaultVoiceSettingsAsync();
Debug.Log($"stability: {result.Stability} | similarity boost: {result.SimilarityBoost}");

Get Voice

var api = new ElevenLabsClient();
var voice = await api.VoicesEndpoint.GetVoiceAsync("voiceId");
Debug.Log($"{voice.Id} | {voice.Name} | {voice.PreviewUrl}");

Edit Voice Settings

Edit the settings for a specific voice.

var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.EditVoiceSettingsAsync(voice, new VoiceSettings(0.7f, 0.7f));
Debug.Log($"Was successful? {success}");

Add Voice

var api = new ElevenLabsClient();
var labels = new Dictionary<string, string>
{
    { "accent", "american" }
};
var audioSamplePaths = new List<string>();
var voice = await api.VoicesEndpoint.AddVoiceAsync("Voice Name", audioSamplePaths, labels);

Edit Voice

var api = new ElevenLabsClient();
var labels = new Dictionary<string, string>
{
    { "age", "young" }
};
var audioSamplePaths = new List<string>();
var success = await api.VoicesEndpoint.EditVoiceAsync(voice, audioSamplePaths, labels);
Debug.Log($"Was successful? {success}");

Delete Voice

var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.DeleteVoiceAsync(voiceId);
Debug.Log($"Was successful? {success}");

Access to your samples, created by you when cloning voices.

Download Voice Sample
var api = new ElevenLabsClient();
var voiceClip = await api.VoicesEndpoint.DownloadVoiceSampleAsync(voice, sample);
Delete Voice Sample
var api = new ElevenLabsClient();
var success = await api.VoicesEndpoint.DeleteVoiceSampleAsync(voiceId, sampleId);
Debug.Log($"Was successful? {success}");

Access to your previously synthesized audio clips including its metadata.

Get History

Get metadata about all your generated audio.

var api = new ElevenLabsClient();
var historyItems = await api.HistoryEndpoint.GetHistoryAsync();

foreach (var item in historyItems.OrderBy(historyItem => historyItem.Date))
{
    Debug.Log($"{item.State} {item.Date} | {item.Id} | {item.Text.Length} | {item.Text}");
}

Get History Item

Get information about a specific item.

var api = new ElevenLabsClient();
var historyItem = await api.HistoryEndpoint.GetHistoryItemAsync(voiceClip.Id);

Download History Audio

var api = new ElevenLabsClient();
var voiceClip = await api.HistoryEndpoint.DownloadHistoryAudioAsync(historyItem);

Download History Items

Downloads the last 100 history items, or the collection of specified items.

var api = new ElevenLabsClient();
var voiceClips = await api.HistoryEndpoint.DownloadHistoryItemsAsync();

Note: to copy the clips directly into your project you can additionally call:

VoiceClipUtilities.CopyIntoProject(editorDownloadDirectory, downloadItems.ToArray());

Delete History Item

var api = new ElevenLabsClient();
var success = await api.HistoryEndpoint.DeleteHistoryItemAsync(historyItem);
Debug.Log($"Was successful? {success}");

Access to your user Information and subscription status.

Get User Info

Gets information about your user account with ElevenLabs.

var api = new ElevenLabsClient();
var userInfo = await api.UserEndpoint.GetUserInfoAsync();

Get Subscription Info

Gets information about your subscription with ElevenLabs.

var api = new ElevenLabsClient();
var subscriptionInfo = await api.UserEndpoint.GetSubscriptionInfoAsync();

com.rest.elevenlabs's People

Contributors

is4code avatar stephenhodgson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

com.rest.elevenlabs's Issues

Error in Editor: The name 'Awaiters' does not exist in the current context

#74 Discussed in https://github.com/RageAgainstThePixel/com.rest.elevenlabs/discussions/75

Originally posted by evya5 February 20, 2024

Bug Report

Overview

After updating the package from 3.2.6 to 3.2.7 this message appears in the unity editor, preventing the program to run.
This did not happen on the previous version and does not happen when I go back to the previous version.

To Reproduce

I just updated the package, nothing else.

Expected behavior

no error message after installment.

Screenshots

image

Additional context

I'm using Unity version 2022.3.16f1

Consider moving away from top menu

As Unity discourages exploiting top level menu I would recommend putting the EvelenLabs dashboard under Tools/ or something similar.

Creating new top level menu items is discouraged by Unity. Imagine if every package that you used created their own menu. It would be total chaos.

I would totally love that. I am using this package in my project which already has too many items at the top level, and Unity's inability to give us the control to (re)move existing items is the only downside to using this package.

elevenlabs playback should be same order as text to dequeue, even if next playback url returned may come sooner

it seems that your dequeue system for short words will be variable in order. your eleven labs call should check for text queue order before playing next queued

here is a simple string sequence to test
"Hello!"
"Lorem ipsum this is omg so long testing 123 lol ipsum dolores park"
"And then."

Note that "And then." will be returned before "Lorem ipsum..."

tldr; your queue is borked. please fix it.

Cannot create FMOD - error during batch synthesis

Bug Report

Overview

I am creating synthesized voices in batch, and some of the results aren't properly imported by unity. I am getting the exception Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Error loading file. ) (stacktrace is attached at the end). I am using the latest 3.2.9 version.

The issue is that for example, VLC is able to play the file. And I can reconvert it using some other 3rd party tool, but it doesn't make too much sense in the batch processing context.

Additional context

Error: Cannot create FMOD::Sound instance for clip "" (FMOD error: Error loading file. )
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Utilities.WebRequestRest.Rest/<DownloadAudioClipAsync>d__43:MoveNext () (at ./Library/PackageCache/com.utilities.rest@2.5.3/Runtime/Rest.cs:680)
System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
Utilities.Async.AwaiterExtensions:RunOnUnityScheduler (System.Action) (at ./Library/PackageCache/com.utilities.async@2.1.3/Runtime/Async/AwaiterExtensions.cs:248)
Utilities.Async.SimpleCoroutineAwaiter:Complete (System.Exception) (at ./Library/PackageCache/com.utilities.async@2.1.3/Runtime/Async/SimpleCoroutineAwaiter.cs:47)
Utilities.Async.AwaiterExtensions/<ReturnVoid>d__27:MoveNext () (at ./Library/PackageCache/com.utilities.async@2.1.3/Runtime/Async/AwaiterExtensions.cs:334)
Unity.EditorCoroutines.Editor.EditorCoroutine:ProcessIEnumeratorRecursive (System.Collections.IEnumerator) (at ./Library/PackageCache/com.unity.editorcoroutines@1.0.0/Editor/EditorCoroutine.cs:148)
Unity.EditorCoroutines.Editor.EditorCoroutine:MoveNext () (at ./Library/PackageCache/com.unity.editorcoroutines@1.0.0/Editor/EditorCoroutine.cs:115)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Voice Settings Overridden

Bug Report

Overview

Whenever sending a TextToSpeech request, regardless of including Voice Settings, the voice settings are reset. This issue persists for all cloned voices. I've attached a before/after picture to demonstrate this, along with the Unity log before sending the request. In the attached screenshots, the bottom-most picture is before sending the web request, the middle picture is after, and the top-most Unity log screenshot shows OG voice settings before being overridden.

To Reproduce

Steps to reproduce the behavior:

  1. Configure Voice Settings in Eleven Labs Dashboard.
  2. Send a TexttoSpeech request for a specific cloned voice
  3. Return to Eleven Labs Dashboard, refresh, and you'll notice the voice settings are reconfigured.

Expected behavior

The returning audio clip should be generated using the pre-configured voice settings for a specific voice clone.

Screenshots

UnityLog
VoiceAfter
VoiceBefore

Additional context

This bug has overridden all my tested cloned voices. If I can be of help, given some direction for investigating deeper, I'm happy to help further debug the issue.

Audio Streaming

Feature Request

Is your feature request related to a problem? Please describe.

Yes, i want to reinforce the need for streaming support. I am encountering the mentioned instabilities in Stream Text to Speech

Describe the solution you'd like

Unity support for Stream Text to Speech

Describe alternatives you've considered

currently i am loading the full audio and its a very long delay for multi-page text.

Additional context

I realize this may be out of your control, but alternative solutions would be appreciated, is Unity aware of and tracking this bug?

<_UIKBFeedbackGenerator: 0x28240bd00>: Couldn't update haptics muting for dictation audio recording. No engine.

Bug Report

Overview

when dictation on keyboard is attempted this occurs
<_UIKBFeedbackGenerator: 0x28240bd00>: Couldn't update haptics muting for dictation audio recording. No engine.

To Reproduce

Steps to reproduce the behavior:

  1. Build to iOS device
  2. try to input text using the mic for dictation
  3. notice the static

Expected behavior

the static should not sound
should not see this in xcode

Multilingual Models

Feature Request

I'm currently using this API for a chatbot, the language it uses is not English, but I can't seem to find the way to configure the language model, so as of right now its speaking Spanish with an American accent which would be an interesting feature but not what my goal is.
I'd like to be able to configure the Multilingual Model through script which means: choosing between Eleven English v1, Eleven Multilingual v1 and Eleven Multilingual v2.
Maybe this feature is already implemented, if that's the case, I'd advice to please add it to the documentation.

Generated audio is broken, even on the website.

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.

Question about api integration with Unity Projects

Hey team, I have a question regarding api integration in project files.
I am using Rider and trying to access the api for a Unity project that is targeting framework 4.7.2. As far as I know Unity only supports up to target framework 4.x, so I am confused on how to integrate this into my Rider project. I have tried installing via Nuget, but it seems to require framework 6, which is not supported for the project that I am implementing this with. Any help would be appreciated!

Small bug with error out when Stability is 0

In the Dashboard, when attempting to save a voice and setting Stability to 0, it will error out.

Utilities.WebRequestRest.RestException: [422] https://api.elevenlabs.io/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM Failed!
[Headers]
date: Mon, 17 Jul 2023 16:49:46 GMT
server: uvicorn
content-length: 137
content-type: application/json
access-control-allow-origin: *
access-control-allow-headers: *
access-control-allow-methods: POST, OPTIONS, DELETE, GET
Via: 1.1 google
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[Data] 137 bytes
[Body]
{"detail":[{"loc":["body","voice_settings"],"msg":"__init__() missing 1 required positional argument: 'stability'","type":"type_error"}]}
[Errors]
HTTP/1.1 422 Unprocessable Entity


  at Utilities.WebRequestRest.Rest.Validate (Utilities.WebRequestRest.Response response, System.Boolean debug, System.String methodName) [0x00020] in D:\projectvr\project\Library\PackageCache\[email protected]\Runtime\Rest.cs:1145 
  at ElevenLabs.TextToSpeech.TextToSpeechEndpoint.TextToSpeechAsync (System.String text, ElevenLabs.Voices.Voice voice, ElevenLabs.Voices.VoiceSettings voiceSettings, ElevenLabs.Models.Model model, System.Nullable`1[T] optimizeStreamingLatency, System.String saveDirectory, System.Boolean deleteCachedFile, System.Threading.CancellationToken cancellationToken) [0x003de] in D:\projectvr\project\Library\PackageCache\[email protected]\Runtime\TextToSpeech\TextToSpeechEndpoint.cs:113 
  at ElevenLabs.Editor.ElevenLabsEditorWindow.GenerateSynthesizedText () [0x000cf] in D:\projectvr\project\Library\PackageCache\[email protected]\Editor\ElevenLabsEditorWindow.cs:1029 
UnityEngine.Debug:LogError (object)
ElevenLabs.Editor.ElevenLabsEditorWindow/<GenerateSynthesizedText>d__93:MoveNext () (at Library/PackageCache/[email protected]/Editor/ElevenLabsEditorWindow.cs:1053)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Tuple`2<string, UnityEngine.AudioClip>>:SetException (System.Exception)
ElevenLabs.TextToSpeech.TextToSpeechEndpoint/<TextToSpeechAsync>d__3:MoveNext () (at Library/PackageCache/[email protected]/Runtime/TextToSpeech/TextToSpeechEndpoint.cs:146)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Utilities.WebRequestRest.Response>:SetResult (Utilities.WebRequestRest.Response)
Utilities.WebRequestRest.Rest/<PostAsync>d__10:MoveNext () (at Library/PackageCache/[email protected]/Runtime/Rest.cs:154)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<Utilities.WebRequestRest.Response>:SetResult (Utilities.WebRequestRest.Response)
Utilities.WebR

Of course, this suggests client doesn't send the parameter to the API at all. Thank you for this wrapper by the way. It's excellent.

Application freezes on first voice request

I think this is more of a question than a bug but we're seeing large spikes when processing text.

We're using the latest version of the SDK & Unity 2021.3.21f1.
This is running on a Meta Quest 3 but we're also seeing this when running in the editor.

Pretty much all requests we make after the first one are absolutely fine but the first one freezes the application for a second or two.

I've taken a look at the samples but it has the same results.

Below is the code we've been using for a while.

    public void ExecuteTask(string answer)
    {
         if (_isReady)
             Execute(answer);
    }
    
    private async void Execute(string answer)
    {
        _isReady = false;

        var api = new ElevenLabsClient();

        var voice = await api.VoicesEndpoint.GetVoiceAsync(voiceData.DefaultVoice.ID);

        var voiceClip = await api.TextToSpeechEndpoint.TextToSpeechAsync(answer, voice, model: Model.EnglishTurboV2);

        if (_audioSource.isPlaying)
        {
            _audioSource.Stop();
        }

        onAudioProcessed?.Invoke();

        _audioSource.clip = voiceClip.AudioClip;
        _audioSource.Play();

        StartCoroutine(CheckAudio());
    }

Arabic Encoding

It appears that the API doesn't encode Arabic correctly, Arabic text generated through the API is 'distorted' while Arabic text generated on the website, works as intended.

Access to Eleven Turbo v2

I can see that you can access Turbo v2 via the dashboard but is it possible to access this via code?
I assume setting this via the dashboard doesn't configure it for for getting voices via code

Getting voices in WebGL builds cause an error

Bug Report

Overview

When trying to get the available voices in WebGL, it returns the following error on build:
"DllNotFoundException: Unable to load DLL 'libc'."
Maybe this happens with other calls as well, but since "GetAllVoicesAsync" is the first one, I can't tell.

To Reproduce

Steps to reproduce the behavior:

  1. Build to WebGL using Unity 2021.3.25f
  2. Wait for the call
  3. Get the error

If it doesn't work on Web I'm sorry, tried searching on the ReadMe, but didn't found.

Unity 2022.2 Fails to serialize objects to json properly

Bug Report

2023/05/25 12:16:36.835 9596 9634 Error Unity JsonSerializationException: Unable to find a constructor to use for type ElevenLabs.Voices.Sample. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'samples[0].sample_id', line 1, position 78.
2023/05/25 12:16:36.835 9596 9634 Error Unity   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x00000] in <00000000000000000000000000000000>:0 
2023/05/25 12:16:36.835 9596 9634 Error Unity   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, New

Overview

Execution Error when call api.VoicesEndpoint.GetVoiceAsync(IdElevenLabs) which Unity 2022.2.20

To Reproduce

Steps to reproduce the behavior:

  1. Create a new project in Unity 2022.2.20
  2. Configure for Android with I2CPP
  3. Add this pakage
  4. Put the api key
  5. Put a script with this in the start method:
        ElevenLabsClient api = new ElevenLabsClient();
        Voice voice = (await api.VoicesEndpoint.GetVoiceAsync(IdVoiceElevenLabs));
  1. Buid & Run and it woks OK with no error
  2. Add URP Pakage and configure Graphics in Player settings to use it
  3. Build & Run and produce an error when execure GetVoiceAsync

Expected behavior

No error and recive a correct voice return

In Unity 2021.3.24f1 works good with no error

Stream Text to Speech

In the new version (3.0.1), the downloaded voice is reproduced as the voice of a squirrel.

Get Key from %APPDATA% instead

Feature Request

Is there a way for us to get the ElevenLabs key from %APPDATA% .json file instead?

Is your feature request related to a problem? Please describe.

I would want to be able to ship my Unity Game to other users so I would like to at least stop unwanted users from abusing my key.

Describe the solution you'd like

Creating a way (Or teaching me how to if it's available right now) to retrieve keys from a .json file

Plugin fails deserializing voices

Hello! I'm on the latest package.

When the inspector is looking at the Eleven Labs Configuration file or trying to load voices in the Dashboard, it repeatedly throws the error:
Newtonsoft.Json.JsonSerializationException: A member with the name 'name' already exists on 'ElevenLabs.Voices.Voice'. Use the JsonPropertyAttribute to specify another name.

image

Variable Gap between playing queued streams

Feature Request

Variable Gap between playing queued streams

Is your feature request related to a problem? Please describe.

Current queue seems to lead to distortion of voices.

Describe the solution you'd like

Maybe adding in 0.2f seconds or variable time between each could help.

ElevenLabs download audio in WebGL Build

Bug Report

Overview

I have a problem with downloading from ElevenLabs of the audios in a WebGl build of my application, follow the browser logs is by CORS, that I can not load the audios and failure to download with Utilities.WebRequestRest. Has anyone encountered this error?

Screenshots

Screenshot 2023-11-22 at 11 00 56 AM

Error in Editor: The name 'Awaiters' does not exist in the current context

Bug Report

Overview

After updating the package from 3.2.6 to 3.2.7 this message appears in the unity editor, preventing the program to run.
This did not happen on the previous version and does not happen when I go back to the previous version.

To Reproduce

I just updated the package, nothing else.

Expected behavior

no error message after installment.

Screenshots

image

Additional context

I'm using Unity version 2022.3.16f1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.