This example assumes using AssemblyAI; is in scope and apiKey contains your AssemblyAI API key.
1 2 3 4 5 6 7 8 9101112131415161718192021
usingvarclient=GetAuthenticatedApi();varfileUrl="https://github.com/AssemblyAI-Community/audio-examples/raw/main/20230607_me_canadian_wildfires.mp3";// You can also transcribe a local file by passing in a file path// var filePath = "./path/to/file.mp3";// var uploadedFile = await client.Files.UploadAsync(await File.ReadAllBytesAsync(filePath));// fileUrl = uploadedFile.UploadUrl;Transcripttranscript=awaitclient.Transcripts.SubmitAsync(newTranscriptParams{AudioUrl=fileUrl,SpeechModels=[],LanguageDetection=true,SpeakerLabels=true,// Identify speakers in your audiosAutoHighlights=true,// Identifying highlights in your audio});transcript.EnsureStatusCompleted();Console.WriteLine(transcript);