Transcribe a WAV file from disk and print the returned transcript text.
This example assumes using ElevenLabs; is in scope and apiKey contains your ElevenLabs API key.
1 2 3 4 5 6 7 8 910111213141516171819202122
usingvarclient=newElevenLabsClient(apiKey);// Load an audio file to transcribe.byte[]audioFile=awaitFile.ReadAllBytesAsync(Path.Combine(AppContext.BaseDirectory,"Resources","hello-in-russian-24k-pcm16.wav"));// Submit the file for transcription.vartranscription=awaitclient.SpeechToText2.ConvertAsync(modelId:BodySpeechToTextV1SpeechToTextPostModelId.ScribeV1,file:audioFile,filename:"hello-in-russian-24k-pcm16.wav",languageCode:"ru");// Print the transcript text when it is available.vartranscriptText=transcription.Value1is{}chunk?chunk.Text:null;if(!string.IsNullOrWhiteSpace(transcriptText)){Console.WriteLine(transcriptText);}