{"id":14961005,"url":"https://github.com/rageagainstthepixel/com.rest.elevenlabs","last_synced_at":"2025-04-06T22:12:08.043Z","repository":{"id":75830251,"uuid":"604283245","full_name":"RageAgainstThePixel/com.rest.elevenlabs","owner":"RageAgainstThePixel","description":"A non-official Eleven Labs voice synthesis client for Unity (UPM)","archived":false,"fork":false,"pushed_at":"2025-03-16T17:55:39.000Z","size":2551,"stargazers_count":89,"open_issues_count":3,"forks_count":13,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T21:09:49.833Z","etag":null,"topics":["ai","ml","openupm","tts","unity","unity3d","upm","upm-package","voice-synthesis"],"latest_commit_sha":null,"homepage":"https://elevenlabs.io/?from=partnerbrown9849","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RageAgainstThePixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"StephenHodgson","patreon":"RageAgainstThePixel"}},"created_at":"2023-02-20T18:15:32.000Z","updated_at":"2025-03-08T23:48:14.000Z","dependencies_parsed_at":"2024-12-17T03:11:16.452Z","dependency_job_id":"689eb8dc-28ca-4293-bc08-2b1cacbfe280","html_url":"https://github.com/RageAgainstThePixel/com.rest.elevenlabs","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.4444444444444444,"last_synced_commit":"e7f175b0b9b79dceb1f3c2d3ccb15e66a9037a08"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":"RageAgainstThePixel/upm-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.elevenlabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.elevenlabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.elevenlabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RageAgainstThePixel%2Fcom.rest.elevenlabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RageAgainstThePixel","download_url":"https://codeload.github.com/RageAgainstThePixel/com.rest.elevenlabs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557770,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ml","openupm","tts","unity","unity3d","upm","upm-package","voice-synthesis"],"created_at":"2024-09-24T13:23:37.567Z","updated_at":"2025-04-06T22:12:08.004Z","avatar_url":"https://github.com/RageAgainstThePixel.png","language":"C#","funding_links":["https://github.com/sponsors/StephenHodgson","https://patreon.com/RageAgainstThePixel"],"categories":[],"sub_categories":[],"readme":"# com.rest.elevenlabs\n\n[![Discord](https://img.shields.io/discord/855294214065487932.svg?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/xQgMW9ufN4) [![openupm](https://img.shields.io/npm/v/com.rest.elevenlabs?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.rest.elevenlabs/) [![openupm](https://img.shields.io/badge/dynamic/json?color=brightgreen\u0026label=downloads\u0026query=%24.downloads\u0026suffix=%2Fmonth\u0026url=https%3A%2F%2Fpackage.openupm.com%2Fdownloads%2Fpoint%2Flast-month%2Fcom.rest.elevenlabs)](https://openupm.com/packages/com.rest.elevenlabs/)\n\nA non-official [ElevenLabs](https://elevenlabs.io/?from=partnerbrown9849) voice synthesis RESTful client for the [Unity](https://unity.com/) Game Engine.\n\nBased on [ElevenLabs-DotNet](https://github.com/RageAgainstThePixel/ElevenLabs-DotNet)\n\nI am not affiliated with ElevenLabs and an account with api access is required.\n\n***All copyrights, trademarks, logos, and assets are the property of their respective owners.***\n\n## Installing\n\nRequires Unity 2021.3 LTS or higher.\n\nThe recommended installation method is though the unity package manager and [OpenUPM](https://openupm.com/packages/com.rest.elevenlabs).\n\n### Via Unity Package Manager and OpenUPM\n\n#### Terminal\n\n```bash\nopenupm add com.rest.elevenlabs\n```\n\n#### Manual\n\n- Open your Unity project settings\n- Select the `Package Manager`\n![scoped-registries](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/package-manager-scopes.png)\n- Add the OpenUPM package registry:\n  - Name: `OpenUPM`\n  - URL: `https://package.openupm.com`\n  - Scope(s):\n    - `com.rest.elevenlabs`\n    - `com.utilities`\n- Open the Unity Package Manager window\n- Change the Registry from Unity to `My Registries`\n- Add the `ElevenLabs` package\n\n### Via Unity Package Manager and Git url\n\n\u003e [!WARNING]\n\u003e This repo has dependencies on other repositories! You are responsible for adding these on your own.\n\n- Open your Unity Package Manager\n- Add package from git url: `https://github.com/RageAgainstThePixel/com.rest.elevenlabs.git#upm`\n  - [com.utilities.async](https://github.com/RageAgainstThePixel/com.utilities.async)\n  - [com.utilities.extensions](https://github.com/RageAgainstThePixel/com.utilities.extensions)\n  - [com.utilities.audio](https://github.com/RageAgainstThePixel/com.utilities.audio)\n  - [com.utilities.encoder.ogg](https://github.com/RageAgainstThePixel/com.utilities.encoder.ogg)\n  - [com.utilities.encoder.wav](https://github.com/RageAgainstThePixel/com.utilities.encoder.wav)\n  - [com.utilities.rest](https://github.com/RageAgainstThePixel/com.utilities.rest)\n\n---\n\n## [Documentation](https://rageagainstthepixel.github.io/ElevenLabs-DotNet)\n\n\u003e Check out our new api docs!\n\n\u003chttps://rageagainstthepixel.github.io/ElevenLabs-DotNet\u003e\n\n### Table of Contents\n\n- [Authentication](#authentication)\n- [API Proxy](#api-proxy)\n- [Editor Dashboard](#editor-dashboard)\n  - [Speech Synthesis Dashboard](#speech-synthesis-dashboard)\n  - [Voice Lab Dashboard](#voice-lab-dashboard)\n    - [Voice Designer Dashboard](#voice-designer-dashboard)\n    - [Voice Cloning Dashboard](#voice-cloning-dashboard)\n  - [History](#history)\n- [Text to Speech](#text-to-speech)\n  - [Stream Text To Speech](#stream-text-to-speech)\n- [Voices](#voices)\n  - [Get Shared Voices](#get-shared-voices)\n  - [Get All Voices](#get-all-voices)\n  - [Get Default Voice Settings](#get-default-voice-settings)\n  - [Get Voice](#get-voice)\n  - [Edit Voice Settings](#edit-voice-settings)\n  - [Add Voice](#add-voice)\n  - [Edit Voice](#edit-voice)\n  - [Delete Voice](#delete-voice)\n  - [Samples](#samples)\n    - [Download Voice Sample](#download-voice-sample)\n    - [Delete Voice Sample](#delete-voice-sample)\n- [Dubbing](#dubbing)\n  - [Dub](#dub)\n  - [Get Dubbing Metadata](#get-dubbing-metadata)\n  - [Get Transcript for Dub](#get-transcript-for-dub)\n  - [Get dubbed file](#get-dubbed-file)\n  - [Delete Dubbing Project](#delete-dubbing-project)\n- [SFX Generation](#sfx-generation)\n- [History](#history)\n  - [Get History](#get-history)\n  - [Get History Item](#get-history-item)\n  - [Download History Audio](#download-history-audio)\n  - [Download History Items](#download-history-items)\n  - [Delete History Item](#delete-history-item)\n- [User](#user)\n  - [Get User Info](#get-user-info)\n  - [Get Subscription Info](#get-subscription-info)\n\n### Authentication\n\nThere are 4 ways to provide your API keys, in order of precedence:\n\n:warning: 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.\n\n1. [Pass keys directly with constructor](#pass-keys-directly-with-constructor) :warning:\n2. [Unity Scriptable Object](#unity-scriptable-object) :warning:\n3. [Load key from configuration file](#load-key-from-configuration-file)\n4. [Use System Environment Variables](#use-system-environment-variables)\n\n#### Pass keys directly with constructor\n\n```csharp\nvar api = new ElevenLabsClient(\"yourApiKey\");\n```\n\nOr create a `ElevenLabsAuthentication` object manually\n\n```csharp\nvar api = new ElevenLabsClient(new ElevenLabsAuthentication(\"yourApiKey\"));\n```\n\n#### Unity Scriptable Object\n\nYou can save the key directly into a scriptable object that is located in the `Assets/Resources` folder.\n\nYou can create a new one by using the context menu of the project pane and creating a new `ElevenLabsConfiguration` scriptable object.\n\n![Create new ElevenLabsConfiguration](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/create-scriptable-object.png)\n\n#### Load key from configuration file\n\nAttempts 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.\n\nTo create a configuration file, create a new text file named `.elevenlabs` and containing the line:\n\n##### Json format\n\n```json\n{\n  \"apiKey\": \"yourApiKey\",\n}\n```\n\nYou can also load the file directly with known path by calling a static method in Authentication:\n\n```csharp\nvar api = new ElevenLabsClient(new ElevenLabsAuthentication().LoadFromDirectory(\"your/path/to/.elevenlabs\"));;\n```\n\n#### Use System Environment Variables\n\nUse your system's environment variables specify an api key to use.\n\n- Use `ELEVEN_LABS_API_KEY` for your api key.\n\n```csharp\nvar api = new ElevenLabsClient(new ElevenLabsAuthentication().LoadFromEnvironment());\n```\n\n### [API Proxy](https://github.com/RageAgainstThePixel/ElevenLabs-DotNet/main/ElevenLabs-DotNet-Proxy/README.md)\n\n[![NuGet version (ElevenLabs-DotNet-Proxy)](https://img.shields.io/nuget/v/ElevenLabs-DotNet-Proxy.svg?label=ElevenLabs-DotNet-Proxy\u0026logo=nuget)](https://www.nuget.org/packages/ElevenLabs-DotNet-Proxy/)\n\nUsing either the [ElevenLabs-DotNet](https://github.com/RageAgainstThePixel/ElevenLabs-DotNet) or [com.rest.elevenlabs](https://github.com/RageAgainstThePixel/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.\n\n#### Front End Example\n\nIn 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.\n\nFollow these steps:\n\n1. Setup a new project using either the [ElevenLabs-DotNet](https://github.com/RageAgainstThePixel/ElevenLabs-DotNet) or [com.rest.elevenlabs](https://github.com/RageAgainstThePixel/com.rest.elevenlabs) packages.\n2. Authenticate users with your OAuth provider.\n3. After successful authentication, create a new `ElevenLabsAuthentication` object and pass in the custom token.\n4. Create a new `ElevenLabsSettings` object and specify the domain where your intermediate API is located.\n5. Pass your new `auth` and `settings` objects to the `ElevenLabsClient` constructor when you create the client instance.\n\nHere's an example of how to set up the front end:\n\n```csharp\nvar authToken = await LoginAsync();\nvar auth = new ElevenLabsAuthentication(authToken);\nvar settings = new ElevenLabsSettings(domain: \"api.your-custom-domain.com\");\nvar api = new ElevenLabsClient(auth, settings);\n```\n\nThis 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.\n\n#### Back End Example\n\nIn 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.\n\n1. Create a new [ASP.NET Core minimal web API](https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-6.0) project.\n2. Add the ElevenLabs-DotNet nuget package to your project.\n    - Powershell install: `Install-Package ElevenLabs-DotNet-Proxy`\n    - Dotnet install: `dotnet add package ElevenLabs-DotNet-Proxy`\n    - Manually editing .csproj: `\u003cPackageReference Include=\"ElevenLabs-DotNet-Proxy\" /\u003e`\n3. Create a new class that inherits from `AbstractAuthenticationFilter` and override the `ValidateAuthenticationAsync` method. This will implement the `IAuthenticationFilter` that you will use to check user session token against your internal server.\n4. In `Program.cs`, create a new proxy web application by calling `ElevenLabsProxyStartup.CreateDefaultHost` method, passing your custom `AuthenticationFilter` as a type argument.\n5. Create `ElevenLabsAuthentication` and `ElevenLabsClientSettings` as you would normally with your API keys, org id, or Azure settings.\n\n```csharp\npublic partial class Program\n{\n    private class AuthenticationFilter : AbstractAuthenticationFilter\n    {\n        public override async Task ValidateAuthenticationAsync(IHeaderDictionary request)\n        {\n            await Task.CompletedTask; // remote resource call\n\n            // You will need to implement your own class to properly test\n            // custom issued tokens you've setup for your end users.\n            if (!request[\"xi-api-key\"].ToString().Contains(TestUserToken))\n            {\n                throw new AuthenticationException(\"User is not authorized\");\n            }\n        }\n    }\n\n    public static void Main(string[] args)\n    {\n        var client = new ElevenLabsClient();\n        var proxy = ElevenLabsProxyStartup.CreateDefaultHost\u003cAuthenticationFilter\u003e(args, client);\n        proxy.Run();\n    }\n}\n```\n\nOnce 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.\n\n### Editor Dashboard\n\nYou can perform all of the same actions from the ElevenLabs website, in the Editor using the ElevenLabs Dashboard!\n\n`Window/Dashboards/ElevenLabs`\n\n![dashboard](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/dashboard.png)\n\n#### Speech Synthesis Dashboard\n\nJust 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!\n\n![Speech Synthesis](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/voice-synthesis-editor.png)\n\n#### Voice Lab Dashboard\n\nJust like in the ElevenLabs website, you can manage all your voices directly in the editor.\n\n![Voice Lab](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/voice-lab-editor.png)\n\n##### Voice Designer Dashboard\n\nSelecting `Create New Voice` will display a popup where you can design entirely new voices using ElevenLabs generative models.\n\n![Voice Designer](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/voice-design-editor.png)\n\n##### Voice Cloning Dashboard\n\nAdditionally, you're also able to clone a voice from sample recordings.\n\n![Voice Cloning](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/voice-clone-editor.png)\n\n#### History Editor Dashboard\n\nYou also have access to the full list of all your generated samples, ready for download.\n\n![History](ElevenLabs/Packages/com.rest.elevenlabs/Documentation~/images/history-editor.png)\n\n### [Text to Speech](https://docs.elevenlabs.io/api-reference/text-to-speech)\n\nConvert text to speech.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar text = \"The quick brown fox jumps over the lazy dog.\";\nvar voice = (await api.VoicesEndpoint.GetAllVoicesAsync()).FirstOrDefault();\nvar request = new TextToSpeechRequest(voice, text);\nvar voiceClip = await api.TextToSpeechEndpoint.TextToSpeechAsync(request);\naudioSource.PlayOneShot(voiceClip.AudioClip);\n```\n\n\u003e 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:\n\n```csharp\nvoiceClip.CopyIntoProject(editorDownloadDirectory);\n```\n\n#### [Stream Text To Speech](https://docs.elevenlabs.io/api-reference/text-to-speech-stream)\n\nStream text to speech.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar text = \"The quick brown fox jumps over the lazy dog.\";\nvar voice = (await api.VoicesEndpoint.GetAllVoicesAsync()).FirstOrDefault();\nvar partialClips = new Queue\u003cVoiceClip\u003e();\nvar request = new TextToSpeechRequest(voice, message, model: Model.EnglishTurboV2, outputFormat: OutputFormat.PCM_44100);\nvar voiceClip = await api.TextToSpeechEndpoint.StreamTextToSpeechAsync(request, partialClip =\u003e\n{\n    // Note: check demo scene for best practices\n    // on how to handle playback with StreamAudioSource.cs\n    partialClips.Enqueue(partialClip);\n});\n```\n\n### [Voices](https://docs.elevenlabs.io/api-reference/voices)\n\nAccess to voices created either by the user or ElevenLabs.\n\n#### Get Shared Voices\n\nGets a list of shared voices in the public voice library.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar results = await api.SharedVoicesEndpoint.GetSharedVoicesAsync();\nforeach (var voice in results.Voices)\n{\n    Debug.Log($\"{voice.OwnerId} | {voice.VoiceId} | {voice.Date} | {voice.Name}\");\n}\n```\n\n#### Get All Voices\n\nGets a list of all available voices.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar allVoices = await api.VoicesEndpoint.GetAllVoicesAsync();\n\nforeach (var voice in allVoices)\n{\n    Debug.Log($\"{voice.Id} | {voice.Name} | similarity boost: {voice.Settings?.SimilarityBoost} | stability: {voice.Settings?.Stability}\");\n}\n```\n\n#### Get Default Voice Settings\n\nGets the global default voice settings.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar result = await api.VoicesEndpoint.GetDefaultVoiceSettingsAsync();\nDebug.Log($\"stability: {result.Stability} | similarity boost: {result.SimilarityBoost}\");\n```\n\n#### Get Voice\n\n```csharp\nvar api = new ElevenLabsClient();\nvar voice = await api.VoicesEndpoint.GetVoiceAsync(\"voiceId\");\nDebug.Log($\"{voice.Id} | {voice.Name} | {voice.PreviewUrl}\");\n```\n\n#### Edit Voice Settings\n\nEdit the settings for a specific voice.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar success = await api.VoicesEndpoint.EditVoiceSettingsAsync(voice, new VoiceSettings(0.7f, 0.7f));\nDebug.Log($\"Was successful? {success}\");\n```\n\n#### Add Voice\n\n```csharp\nvar api = new ElevenLabsClient();\nvar labels = new Dictionary\u003cstring, string\u003e\n{\n    { \"accent\", \"american\" }\n};\nvar audioSamplePaths = new List\u003cstring\u003e();\nvar voice = await api.VoicesEndpoint.AddVoiceAsync(\"Voice Name\", audioSamplePaths, labels);\n```\n\n#### Edit Voice\n\n```csharp\nvar api = new ElevenLabsClient();\nvar labels = new Dictionary\u003cstring, string\u003e\n{\n    { \"age\", \"young\" }\n};\nvar audioSamplePaths = new List\u003cstring\u003e();\nvar success = await api.VoicesEndpoint.EditVoiceAsync(voice, audioSamplePaths, labels);\nDebug.Log($\"Was successful? {success}\");\n```\n\n#### Delete Voice\n\n```csharp\nvar api = new ElevenLabsClient();\nvar success = await api.VoicesEndpoint.DeleteVoiceAsync(voiceId);\nDebug.Log($\"Was successful? {success}\");\n```\n\n#### [Samples](https://docs.elevenlabs.io/api-reference/samples)\n\nAccess to your samples, created by you when cloning voices.\n\n##### Download Voice Sample\n\n```csharp\nvar api = new ElevenLabsClient();\nvar voiceClip = await api.VoicesEndpoint.DownloadVoiceSampleAsync(voice, sample);\n```\n\n##### Delete Voice Sample\n\n```csharp\nvar api = new ElevenLabsClient();\nvar success = await api.VoicesEndpoint.DeleteVoiceSampleAsync(voiceId, sampleId);\nDebug.Log($\"Was successful? {success}\");\n```\n\n### [Dubbing](https://elevenlabs.io/docs/api-reference/create-dub)\n\n#### Dub\n\nDubs provided audio or video file into given language.\n\n```csharp\nvar api = new ElevenLabsClient();\n// from URI\nvar request = new DubbingRequest(new Uri(\"https://youtu.be/Zo5-rhYOlNk\"), \"ja\", \"en\", 1, true);\n// from file\nvar request = new DubbingRequest(filePath, \"es\", \"en\", 1);\nvar metadata = await api.DubbingEndpoint.DubAsync(request, progress: new Progress\u003cDubbingProjectMetadata\u003e(metadata =\u003e\n{\n    switch (metadata.Status)\n    {\n        case \"dubbing\":\n            Debug.Log($\"Dubbing for {metadata.DubbingId} in progress... Expected Duration: {metadata.ExpectedDurationSeconds:0.00} seconds\");\n            break;\n        case \"dubbed\":\n            Debug.Log($\"Dubbing for {metadata.DubbingId} complete in {metadata.TimeCompleted.TotalSeconds:0.00} seconds!\");\n            break;\n        default:\n            Debug.Log($\"Status: {metadata.Status}\");\n            break;\n    }\n}));\n```\n\n#### Get Dubbing Metadata\n\nReturns metadata about a dubbing project, including whether it’s still in progress or not.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar metadata = api.await GetDubbingProjectMetadataAsync(\"dubbing-id\");\n```\n\n#### Get Dubbed File\n\nReturns downloaded dubbed file path.\n\n\u003e [!IMPORTANT]\n\u003e Videos will be returned in MP4 format and audio only dubs will be returned in MP3.\n\n```csharp\nvar dubbedClipPath = await api.DubbingEndpoint.GetDubbedFileAsync(metadata.DubbingId, request.TargetLanguage);\nvar dubbedClip = await Rest.DownloadAudioClipAsync($\"file://{dubbedClipPath}\", AudioType.MPEG);\naudioSource.PlayOneShot(dubbedClip);\n```\n\n#### Get Transcript for Dub\n\nReturns transcript for the dub in the desired format.\n\n```csharp\nvar srcFile = new FileInfo(audioPath);\nvar transcriptPath = new FileInfo($\"{srcFile.FullName}.dubbed.{request.TargetLanguage}.srt\");\nvar transcriptFile = await api.DubbingEndpoint.GetTranscriptForDubAsync(metadata.DubbingId, request.TargetLanguage);\nawait File.WriteAllTextAsync(transcriptPath.FullName, transcriptFile);\n```\n\n#### Delete Dubbing Project\n\nDeletes a dubbing project.\n\n```csharp\nvar api = new ElevenLabsClient();\nawait api.DubbingEndpoint.DeleteDubbingProjectAsync(\"dubbing-id\");\n```\n\n### SFX Generation\n\nAPI that converts text into sounds \u0026 uses the most advanced AI audio model ever.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar request = new SoundGenerationRequest(\"Star Wars Light Saber parry\");\nvar clip = await api.SoundGenerationEndpoint.GenerateSoundAsync(request);\n```\n\n### [History](https://docs.elevenlabs.io/api-reference/history)\n\nAccess to your previously synthesized audio clips including its metadata.\n\n#### Get History\n\nGet metadata about all your generated audio.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar historyItems = await api.HistoryEndpoint.GetHistoryAsync();\n\nforeach (var item in historyItems.OrderBy(historyItem =\u003e historyItem.Date))\n{\n    Debug.Log($\"{item.State} {item.Date} | {item.Id} | {item.Text.Length} | {item.Text}\");\n}\n```\n\n#### Get History Item\n\nGet information about a specific item.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar historyItem = await api.HistoryEndpoint.GetHistoryItemAsync(voiceClip.Id);\n```\n\n#### Download History Audio\n\n```csharp\nvar api = new ElevenLabsClient();\nvar voiceClip = await api.HistoryEndpoint.DownloadHistoryAudioAsync(historyItem);\n```\n\n#### Download History Items\n\nDownloads the last 100 history items, or the collection of specified items.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar voiceClips = await api.HistoryEndpoint.DownloadHistoryItemsAsync();\n```\n\n\u003e Note: to copy the clips directly into your project you can additionally call:\n\n```csharp\nVoiceClipUtilities.CopyIntoProject(editorDownloadDirectory, downloadItems.ToArray());\n```\n\n#### Delete History Item\n\n```csharp\nvar api = new ElevenLabsClient();\nvar success = await api.HistoryEndpoint.DeleteHistoryItemAsync(historyItem);\nDebug.Log($\"Was successful? {success}\");\n```\n\n### [User](https://docs.elevenlabs.io/api-reference/user)\n\nAccess to your user Information and subscription status.\n\n#### Get User Info\n\nGets information about your user account with ElevenLabs.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar userInfo = await api.UserEndpoint.GetUserInfoAsync();\n```\n\n#### Get Subscription Info\n\nGets information about your subscription with ElevenLabs.\n\n```csharp\nvar api = new ElevenLabsClient();\nvar subscriptionInfo = await api.UserEndpoint.GetSubscriptionInfoAsync();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frageagainstthepixel%2Fcom.rest.elevenlabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frageagainstthepixel%2Fcom.rest.elevenlabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frageagainstthepixel%2Fcom.rest.elevenlabs/lists"}