Replace part of a short WAV clip by submitting the original and target transcript text.
This example assumes using ResembleAI; is in scope and apiKey contains your ResembleAI API key.
1 2 3 4 5 6 7 8 910111213141516171819202122
usingvarclient=newResembleAIClient(apiKey);varfixture=GetPrimaryAudioFixture();varselectedVoice=awaitGetEditableVoiceAsync(client);varaudioBytes=awaitLoadAudioFixtureAsync(fixture);try{// Submit an edit request that replaces the spoken text with new content.varaudioEdit=awaitclient.SubpackageAudioEdit.CreateAudioEditAsync(inputAudio:audioBytes,inputAudioname:fixture.FileName,originalTranscript:fixture.Transcript,targetTranscript:fixture.EditedTranscript,voiceUuid:selectedVoice.Uuid);Console.WriteLine($"Audio edit job: {audioEdit.Item?.Uuid}");}catch(ApiExceptionex){AssertFeatureAvailable(ex,"audio edit");}