Skip to content

Commit

Permalink
- Added VoiceSettings.ctr overload
Browse files Browse the repository at this point in the history
  - Added speed property
  • Loading branch information
StephenHodgson committed Mar 2, 2025
1 parent dfc4344 commit 16c7df9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ElevenLabs-DotNet/ElevenLabs-DotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Version 3.5.0
- Added seed property
- Added applyTextNormalization property
- Removed deprecated optimizeStreamingLatency property
- Added VoiceSettings.ctr overload
- Added speed property
Version 3.4.2
- Added flash models
- Added stream input support to dubbing endpoint
Expand Down
18 changes: 17 additions & 1 deletion ElevenLabs-DotNet/Voices/VoiceSettings.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using System.Text.Json.Serialization;

namespace ElevenLabs.Voices
{
public sealed class VoiceSettings
{
[JsonConstructor]
[Obsolete("use new .ctr overload")]
public VoiceSettings(
float stability = .75f,
float similarityBoost = .75f,
bool speakerBoost = true,
float style = 0.45f)
: this(stability, similarityBoost, style, speakerBoost)
{
}

[JsonConstructor]
public VoiceSettings(
float stability = .75f,
float similarityBoost = .75f,
float style = 0.45f,
bool speakerBoost = true,
float speed = 1f)
{
Stability = stability;
SimilarityBoost = similarityBoost;
Style = style;
SpeakerBoost = speakerBoost;
Speed = speed;
}

[JsonPropertyName("stability")]
Expand All @@ -30,5 +43,8 @@ public VoiceSettings(

[JsonPropertyName("use_speaker_boost")]
public bool SpeakerBoost { get; set; }

[JsonPropertyName("speed")]
public float Speed { get; set; }
}
}

0 comments on commit 16c7df9

Please sign in to comment.