Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropBackgroundAudio is missing from DubAsync #61

Closed
cwule opened this issue Sep 11, 2024 · 6 comments · Fixed by #62
Closed

DropBackgroundAudio is missing from DubAsync #61

cwule opened this issue Sep 11, 2024 · 6 comments · Fixed by #62
Assignees
Labels
bug Something isn't working

Comments

@cwule
Copy link

cwule commented Sep 11, 2024

This property is missing from the payload for the dubbing request via

public async Task<DubbingProjectMetadata> DubAsync(DubbingRequest request, int? maxRetries = null, TimeSpan? pollingInterval = null, IProgress<DubbingProjectMetadata> progress = null, CancellationToken cancellationToken = default)

@cwule cwule added the bug Something isn't working label Sep 11, 2024
@StephenHodgson StephenHodgson added enhancement New feature or request and removed bug Something isn't working labels Sep 11, 2024
@StephenHodgson StephenHodgson self-assigned this Sep 11, 2024
@StephenHodgson
Copy link
Member

Pretty sure this was removed from the OpenAPI spec but I'll double check

@StephenHodgson
Copy link
Member

@cwule this is no longer part of the OpenAPI spec:

"Body_Dub_a_video_or_an_audio_file_v1_dubbing_post": {
    "properties": {
        "mode": {
            "type": "string",
            "title": "Mode",
            "description": "automatic or manual. Manual mode is only supported when creating a dubbing studio project"
        },
        "file": {
            "type": "string",
            "format": "binary",
            "title": "File",
            "description": "A list of file paths to audio recordings intended for voice cloning"
        },
        "csv_file": {
            "type": "string",
            "format": "binary",
            "title": "Csv File",
            "description": "CSV file containing transcription/translation metadata"
        },
        "foreground_audio_file": {
            "type": "string",
            "format": "binary",
            "title": "Foreground Audio File",
            "description": "For use only with csv input"
        },
        "background_audio_file": {
            "type": "string",
            "format": "binary",
            "title": "Background Audio File",
            "description": "For use only with csv input"
        },
        "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the dubbing project."
        },
        "source_url": {
            "type": "string",
            "title": "Source Url",
            "description": "URL of the source video/audio file."
        },
        "source_lang": {
            "type": "string",
            "title": "Source Lang",
            "description": "Source language.",
            "default": "auto"
        },
        "target_lang": {
            "type": "string",
            "title": "Target Lang",
            "description": "The Target language to dub the content into. Can be none if dubbing studio editor is enabled and running manual mode"
        },
        "num_speakers": {
            "type": "integer",
            "title": "Num Speakers",
            "description": "Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers",
            "default": 0
        },
        "watermark": {
            "type": "boolean",
            "title": "Watermark",
            "description": "Whether to apply watermark to the output video.",
            "default": false
        },
        "start_time": {
            "type": "integer",
            "title": "Start Time",
            "description": "Start time of the source video/audio file."
        },
        "end_time": {
            "type": "integer",
            "title": "End Time",
            "description": "End time of the source video/audio file."
        },
        "highest_resolution": {
            "type": "boolean",
            "title": "Highest Resolution",
            "description": "Whether to use the highest resolution available.",
            "default": false
        },
        "dubbing_studio": {
            "type": "boolean",
            "title": "Dubbing Studio",
            "description": "Whether to prepare dub for edits in dubbing studio.",
            "default": false
        }
    },
    "type": "object",
    "title": "Body_Dub_a_video_or_an_audio_file_v1_dubbing_post"
}

@StephenHodgson
Copy link
Member

Hmm maybe I was too quick on this. The API ref docs themselves have it.
So confusing.

@StephenHodgson
Copy link
Member

Actually I already have it in the request object.

bool? dropBackgroundAudio = null,

Use it like so:

var request = new DubbingRequest(filePath, "es", "en", 1, dropBackgroundAudio: true);
var metadata = await ElevenLabsClient.DubbingEndpoint.DubAsync(request, progress: new Progress<DubbingProjectMetadata>(metadata =>
{
    switch (metadata.Status)
    {
        case "dubbing":
            Console.WriteLine($"Dubbing for {metadata.DubbingId} in progress... Expected Duration: {metadata.ExpectedDurationSeconds:0.00} seconds");
            break;
        case "dubbed":
            Console.WriteLine($"Dubbing for {metadata.DubbingId} complete in {metadata.TimeCompleted.TotalSeconds:0.00} seconds!");
            break;
        default:
            Console.WriteLine($"Status: {metadata.Status}");
            break;
    }
}));

@StephenHodgson
Copy link
Member

Ah but I didn't actually put it into the payload in the request method 😅

@StephenHodgson StephenHodgson linked a pull request Sep 14, 2024 that will close this issue
@StephenHodgson StephenHodgson added bug Something isn't working and removed enhancement New feature or request labels Sep 14, 2024
@cwule
Copy link
Author

cwule commented Sep 14, 2024

Great, thanks for looking into that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants