Upload a local WAV file, poll until the transcript completes, and print the recognized text.
This example assumes using ResembleAI; is in scope and apiKey contains your ResembleAI API key.
1 2 3 4 5 6 7 8 9101112131415161718192021
usingvarclient=newResembleAIClient(apiKey);varfixture=GetPrimaryAudioFixture();varaudioBytes=awaitLoadAudioFixtureAsync(fixture);try{// Submit a small local WAV file for transcription.varcreatedTranscript=awaitclient.SubpackageSpeechToText.CreateTranscriptAsync(file:audioBytes,filename:fixture.FileName);// Poll the transcript until it reaches a terminal state.vartranscript=awaitWaitForTranscriptCompletionAsync(client,createdTranscript.Item!.Uuid!.Value);Console.WriteLine(transcript.Item?.Text);AssertTranscriptLooksReasonable(transcript.Item?.Text,fixture);}catch(ApiExceptionex){AssertFeatureAvailable(ex,"speech-to-text");}