This example assumes using Gladia; is in scope and apiKey contains your Gladia API key.
1 2 3 4 5 6 7 8 910111213141516
usingvarapi=newGladiaClient(apiKey);ISpeechToTextClientspeechClient=api;// Transcribe audio using the MEAI ISpeechToTextClient interface.// The client uploads the audio stream and polls until transcription is complete.usingvarhttpClient=newHttpClient();awaitusingvaraudioStream=awaithttpClient.GetStreamAsync("https://cdn.openai.com/API/docs/audio/alloy.wav");varms=newMemoryStream();awaitaudioStream.CopyToAsync(ms);ms.Position=0;varresponse=awaitspeechClient.GetTextAsync(ms);Console.WriteLine($"Text: {response.Text}");