Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ public sealed partial class ElevenLabsClient : global::ElevenLabs.IElevenLabsCli
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
public TextToVoiceClient TextToVoice => new TextToVoiceClient(HttpClient, authorizations: Authorizations)
{
JsonSerializerContext = JsonSerializerContext,
};

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public partial interface IElevenLabsClient : global::System.IDisposable
/// </summary>
public VoiceGenerationClient VoiceGeneration { get; }

/// <summary>
///
/// </summary>
public TextToVoiceClient TextToVoice { get; }

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public partial interface ISpeechToSpeechClient
/// <param name="seed">
/// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed.
/// </param>
/// <param name="removeBackgroundNoise">
/// If set will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer.<br/>
/// Default Value: false
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateSpeechToSpeechByVoiceIdAsync(
Expand All @@ -121,6 +125,7 @@ public partial interface ISpeechToSpeechClient
string? modelId = "eleven_english_sts_v2",
string? voiceSettings = default,
int? seed = default,
bool? removeBackgroundNoise = false,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public partial interface ISpeechToSpeechClient
/// <param name="seed">
/// If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed.
/// </param>
/// <param name="removeBackgroundNoise">
/// If set will remove the background noise from your audio input using our audio isolation model. Only applies to Voice Changer.<br/>
/// Default Value: false
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateSpeechToSpeechByVoiceIdStreamAsync(
Expand All @@ -121,6 +125,7 @@ public partial interface ISpeechToSpeechClient
string? modelId = "eleven_english_sts_v2",
string? voiceSettings = default,
int? seed = default,
bool? removeBackgroundNoise = false,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public partial interface ITextToSpeechClient
/// <param name="nextRequestIds">
/// A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
/// </param>
/// <param name="applyTextNormalization">
/// This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' model.<br/>
/// Default Value: auto
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateTextToSpeechByVoiceIdAsync(
Expand All @@ -141,6 +145,7 @@ public partial interface ITextToSpeechClient
string? nextText = default,
global::System.Collections.Generic.IList<string>? previousRequestIds = default,
global::System.Collections.Generic.IList<string>? nextRequestIds = default,
global::ElevenLabs.BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization? applyTextNormalization = global::ElevenLabs.BodyTextToSpeechV1TextToSpeechVoiceIdPostApplyTextNormalization.Auto,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public partial interface ITextToSpeechClient
/// <param name="nextRequestIds">
/// A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
/// </param>
/// <param name="applyTextNormalization">
/// This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' model.<br/>
/// Default Value: auto
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateTextToSpeechByVoiceIdStreamAsync(
Expand All @@ -141,6 +145,7 @@ public partial interface ITextToSpeechClient
string? nextText = default,
global::System.Collections.Generic.IList<string>? previousRequestIds = default,
global::System.Collections.Generic.IList<string>? nextRequestIds = default,
global::ElevenLabs.BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization? applyTextNormalization = global::ElevenLabs.BodyTextToSpeechStreamingV1TextToSpeechVoiceIdStreamPostApplyTextNormalization.Auto,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public partial interface ITextToSpeechClient
/// <param name="nextRequestIds">
/// A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
/// </param>
/// <param name="applyTextNormalization">
/// This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' model.<br/>
/// Default Value: auto
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateTextToSpeechByVoiceIdStreamWithTimestampsAsync(
Expand All @@ -141,6 +145,7 @@ public partial interface ITextToSpeechClient
string? nextText = default,
global::System.Collections.Generic.IList<string>? previousRequestIds = default,
global::System.Collections.Generic.IList<string>? nextRequestIds = default,
global::ElevenLabs.BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization? applyTextNormalization = global::ElevenLabs.BodyTextToSpeechStreamingWithTimestampsV1TextToSpeechVoiceIdStreamWithTimestampsPostApplyTextNormalization.Auto,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public partial interface ITextToSpeechClient
/// <param name="nextRequestIds">
/// A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.
/// </param>
/// <param name="applyTextNormalization">
/// This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be turned on for 'eleven_turbo_v2_5' model.<br/>
/// Default Value: auto
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.HTTPValidationError> CreateTextToSpeechByVoiceIdWithTimestampsAsync(
Expand All @@ -141,6 +145,7 @@ public partial interface ITextToSpeechClient
string? nextText = default,
global::System.Collections.Generic.IList<string>? previousRequestIds = default,
global::System.Collections.Generic.IList<string>? nextRequestIds = default,
global::ElevenLabs.BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization? applyTextNormalization = global::ElevenLabs.BodyTextToSpeechWithTimestampsV1TextToSpeechVoiceIdWithTimestampsPostApplyTextNormalization.Auto,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#nullable enable

namespace ElevenLabs
{
public partial interface ITextToVoiceClient
{
/// <summary>
/// Generate A Voice Preview From Description<br/>
/// Generate a custom voice based on voice description. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. If you like the a voice previewand want to create the voice call /v1/text-to-voice/create-voice-from-preview with the generated_voice_id to create the voice.
/// </summary>
/// <param name="xiApiKey">
/// Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.
/// </param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.VoicePreviewsResponseModel> CreateTextToVoiceCreatePreviewsAsync(
global::ElevenLabs.BodyGenerateAVoicePreviewFromDescriptionV1TextToVoiceCreatePreviewsPost request,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Generate A Voice Preview From Description<br/>
/// Generate a custom voice based on voice description. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. If you like the a voice previewand want to create the voice call /v1/text-to-voice/create-voice-from-preview with the generated_voice_id to create the voice.
/// </summary>
/// <param name="xiApiKey">
/// Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.
/// </param>
/// <param name="voiceDescription">
/// Description to use for the created voice.<br/>
/// Example: A sassy little squeaky mouse
/// </param>
/// <param name="text">
/// Text to generate, text length has to be between 100 and 1000.<br/>
/// Example: Every act of kindness, no matter how small, carries value and can make a difference, as no gesture of goodwill is ever wasted.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.VoicePreviewsResponseModel> CreateTextToVoiceCreatePreviewsAsync(
string voiceDescription,
string text,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#nullable enable

namespace ElevenLabs
{
public partial interface ITextToVoiceClient
{
/// <summary>
/// Create A New Voice From Voice Preview<br/>
/// Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using /v1/text-to-voice/create-previews.
/// </summary>
/// <param name="xiApiKey">
/// Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.
/// </param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.VoiceResponseModel> CreateTextToVoiceCreateVoiceFromPreviewAsync(
global::ElevenLabs.BodyCreateANewVoiceFromVoicePreviewV1TextToVoiceCreateVoiceFromPreviewPost request,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Create A New Voice From Voice Preview<br/>
/// Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using /v1/text-to-voice/create-previews.
/// </summary>
/// <param name="xiApiKey">
/// Your API key. This is required by most endpoints to access our API programatically. You can view your xi-api-key using the 'Profile' tab on the website.
/// </param>
/// <param name="voiceName">
/// Name to use for the created voice.<br/>
/// Example: Little squeaky mouse
/// </param>
/// <param name="voiceDescription">
/// Description to use for the created voice.<br/>
/// Example: A sassy little squeaky mouse
/// </param>
/// <param name="generatedVoiceId">
/// The generated_voice_id to create, call POST /v1/voice-generation/generate-voice and fetch the generated_voice_id from the response header if don't have one yet.<br/>
/// Example: 37HceQefKmEi3bGovXjL
/// </param>
/// <param name="labels">
/// Optional, metadata to add to the created voice. Defaults to None.
/// </param>
/// <param name="playedNotSelectedVoiceIds">
/// List of voice ids that the user has played but not selected. Used for RLHF.
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::ElevenLabs.VoiceResponseModel> CreateTextToVoiceCreateVoiceFromPreviewAsync(
string voiceName,
string voiceDescription,
string generatedVoiceId,
string? xiApiKey = default,
global::System.Collections.Generic.Dictionary<string, string>? labels = default,
global::System.Collections.Generic.IList<string>? playedNotSelectedVoiceIds = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
34 changes: 34 additions & 0 deletions src/libs/ElevenLabs/Generated/ElevenLabs.ITextToVoiceClient.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#nullable enable

namespace ElevenLabs
{
/// <summary>
/// If no httpClient is provided, a new one will be created.<br/>
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used.
/// </summary>
public partial interface ITextToVoiceClient : global::System.IDisposable
{
/// <summary>
/// The HttpClient instance.
/// </summary>
public global::System.Net.Http.HttpClient HttpClient { get; }

/// <summary>
/// The base URL for the API.
/// </summary>
public System.Uri? BaseUri { get; }

/// <summary>
/// The authorizations to use for the requests.
/// </summary>
public global::System.Collections.Generic.List<global::ElevenLabs.EndPointAuthorization> Authorizations { get; }

/// <summary>
///
/// </summary>
global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public partial interface IUsageClient
global::System.DateTimeOffset startUnix,
global::System.DateTimeOffset endUnix,
bool? includeWorkspaceMetrics = false,
global::ElevenLabs.GetCharactersUsageMetricsV1UsageCharacterStatsGetBreakdownType? breakdownType = global::ElevenLabs.GetCharactersUsageMetricsV1UsageCharacterStatsGetBreakdownType.None,
global::ElevenLabs.AllOf<global::ElevenLabs.BreakdownTypes?>? breakdownType = default,
string? xiApiKey = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Loading