Skip to content

Instantly share code, notes, and snippets.

@dvonthenen
Last active April 9, 2024 18:55
Show Gist options
  • Save dvonthenen/7632e33e954c73d5def15bf59cadf728 to your computer and use it in GitHub Desktop.
Save dvonthenen/7632e33e954c73d5def15bf59cadf728 to your computer and use it in GitHub Desktop.
[.NET v4] Code tutorial: Transcribe pre-recorded audio
Step 1: Is the same
Step 2: Is the same
Step 3: Same
Step 4: Same
Step 5: Please see program.cs below
Step 6: Same
Step 7: Same
using System.Text.Json;
using Deepgram.Models.PreRecorded.v1;
namespace MyProgram
{
class Program
{
static async Task Main(string[] args)
{
// Initialize Library with default logging
// Normal logging is "Info" level
Library.Initialize();
// Set your Deepgram API KEY below
var deepgramClient = new PreRecordedClient("Set DEEPGRAM_API_KEY here");
var response = await deepgramClient.TranscribeUrl(
new UrlSource("https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav"),
new PrerecordedSchema()
{
Model = "nova-2",
});
Console.WriteLine(JsonSerializer.Serialize(response));
// Teardown Library
Library.Terminate();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment