-
Notifications
You must be signed in to change notification settings - Fork 32
/
Program.cs
44 lines (37 loc) · 1.38 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2024 Deepgram .NET SDK contributors. All Rights Reserved.
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT
using Deepgram.Models.Listen.v1.REST;
namespace PreRecorded
{
class Program
{
static async Task Main(string[] args)
{
// Initialize Library with default logging
// Normal logging is "Info" level
Library.Initialize();
// use the client factory with a API Key set with the "DEEPGRAM_API_KEY" environment variable
var deepgramClient = ClientFactory.CreateListenRESTClient();
// check to see if the file exists
if (!File.Exists(@"CallCenterPhoneCall.mp3"))
{
Console.WriteLine("Error: File 'CallCenterPhoneCall.mp3' not found.");
return;
}
var audioData = File.ReadAllBytes(@"CallCenterPhoneCall.mp3");
var response = await deepgramClient.TranscribeFile(
audioData,
new PreRecordedSchema()
{
Model = "nova-2",
Punctuate = true,
Summarize = "v2",
});
Console.WriteLine(response);
Console.ReadKey();
// Teardown Library
Library.Terminate();
}
}
}