diff --git a/ElevenLabs-DotNet-Tests/TestFixture_08_DubbingEndpoint.cs b/ElevenLabs-DotNet-Tests/TestFixture_08_DubbingEndpoint.cs index 933001a..4706688 100644 --- a/ElevenLabs-DotNet-Tests/TestFixture_08_DubbingEndpoint.cs +++ b/ElevenLabs-DotNet-Tests/TestFixture_08_DubbingEndpoint.cs @@ -62,7 +62,7 @@ public async Task Test_02_Dubbing_Url() { Assert.NotNull(ElevenLabsClient.DubbingEndpoint); - var request = new DubbingRequest(new Uri("https://youtu.be/Zo5-rhYOlNk"), "ja", "en", 1, true); + var request = new DubbingRequest(new Uri("https://youtu.be/Zo5-rhYOlNk"), "ja", "en", 1, watermark: true, dropBackgroundAudio: true); var metadata = await ElevenLabsClient.DubbingEndpoint.DubAsync(request, progress: new Progress(metadata => { switch (metadata.Status) diff --git a/ElevenLabs-DotNet/Dubbing/DubbingEndpoint.cs b/ElevenLabs-DotNet/Dubbing/DubbingEndpoint.cs index 42148ff..efa9738 100644 --- a/ElevenLabs-DotNet/Dubbing/DubbingEndpoint.cs +++ b/ElevenLabs-DotNet/Dubbing/DubbingEndpoint.cs @@ -88,6 +88,16 @@ public async Task DubAsync(DubbingRequest request, int? { payload.Add(new StringContent(request.HighestResolution.Value.ToString()), "highest_resolution"); } + + if (request.DropBackgroundAudio.HasValue) + { + payload.Add(new StringContent(request.DropBackgroundAudio.ToString().ToLower()), "drop_background_audio"); + } + + if (request.UseProfanityFilter.HasValue) + { + payload.Add(new StringContent(request.UseProfanityFilter.ToString().ToLower()), "use_profanity_filter"); + } } finally { diff --git a/ElevenLabs-DotNet/Dubbing/DubbingRequest.cs b/ElevenLabs-DotNet/Dubbing/DubbingRequest.cs index f00afa5..38612ce 100644 --- a/ElevenLabs-DotNet/Dubbing/DubbingRequest.cs +++ b/ElevenLabs-DotNet/Dubbing/DubbingRequest.cs @@ -18,8 +18,9 @@ public DubbingRequest( int? endTime = null, bool? highestResolution = null, bool? dropBackgroundAudio = null, + bool? useProfanityFilter = null, string projectName = null) - : this([filePath], targetLanguage, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, projectName) + : this([filePath], targetLanguage, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, useProfanityFilter, projectName) { } @@ -33,8 +34,9 @@ public DubbingRequest( int? endTime = null, bool? highestResolution = null, bool? dropBackgroundAudio = null, + bool? useProfanityFilter = null, string projectName = null) - : this(targetLanguage, null, filePaths, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, projectName) + : this(targetLanguage, null, filePaths, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, useProfanityFilter, projectName) { } @@ -48,8 +50,9 @@ public DubbingRequest( int? endTime = null, bool? highestResolution = null, bool? dropBackgroundAudio = null, + bool? useProfanityFilter = null, string projectName = null) - : this(targetLanguage, sourceUrl, null, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, projectName) + : this(targetLanguage, sourceUrl, null, sourceLanguage, numberOfSpeakers, watermark, startTime, endTime, highestResolution, dropBackgroundAudio, useProfanityFilter, projectName) { } @@ -64,6 +67,7 @@ private DubbingRequest( int? endTime = null, bool? highestResolution = null, bool? dropBackgroundAudio = null, + bool? useProfanityFilter = null, string projectName = null) { ArgumentException.ThrowIfNullOrWhiteSpace(targetLanguage); @@ -122,6 +126,7 @@ private DubbingRequest( EndTime = endTime; HighestResolution = highestResolution; DropBackgroundAudio = dropBackgroundAudio; + UseProfanityFilter = useProfanityFilter; ProjectName = projectName; } @@ -184,6 +189,11 @@ private DubbingRequest( /// public bool? DropBackgroundAudio { get; } + /// + /// [BETA] Whether transcripts should have profanities censored with the words '[censored]'. + /// + public bool? UseProfanityFilter { get; } + /// /// Name of the dubbing project. /// diff --git a/ElevenLabs-DotNet/ElevenLabs-DotNet.csproj b/ElevenLabs-DotNet/ElevenLabs-DotNet.csproj index cdb8f2e..cdfde1a 100644 --- a/ElevenLabs-DotNet/ElevenLabs-DotNet.csproj +++ b/ElevenLabs-DotNet/ElevenLabs-DotNet.csproj @@ -25,8 +25,11 @@ All copyrights, trademarks, logos, and assets are the property of their respecti false true true - 3.0.2 + 3.0.3 +Version 3.0.3 +- Fix DubbingRequest.DropBackgroundAudio flag not properly being set +- Added DubbingRequest.UseProfanityFilter flag Version 3.0.2 - Cleanup and polish for Dubbing API Version 3.0.1 diff --git a/ElevenLabs-DotNet/Voices/SharedVoicesEndpoint.cs b/ElevenLabs-DotNet/Voices/SharedVoicesEndpoint.cs index de8ade0..a19bc66 100644 --- a/ElevenLabs-DotNet/Voices/SharedVoicesEndpoint.cs +++ b/ElevenLabs-DotNet/Voices/SharedVoicesEndpoint.cs @@ -21,8 +21,8 @@ public SharedVoicesEndpoint(ElevenLabsClient client) : base(client) { } /// . public async Task GetSharedVoicesAsync(SharedVoiceQuery query = null, CancellationToken cancellationToken = default) { - using var response = await client.Client.GetAsync(GetUrl(queryParameters: query?.ToQueryParams()), cancellationToken); - var responseAsString = await response.ReadAsStringAsync(EnableDebug, cancellationToken); + using var response = await client.Client.GetAsync(GetUrl(queryParameters: query?.ToQueryParams()), cancellationToken).ConfigureAwait(false); + var responseAsString = await response.ReadAsStringAsync(EnableDebug, cancellationToken).ConfigureAwait(false); return JsonSerializer.Deserialize(responseAsString, ElevenLabsClient.JsonSerializationOptions); } }