-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathProgram.cs
40 lines (33 loc) · 1.27 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
// 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();
// create a ListenRESTClient directly (without using the factory method) with a API Key
// set using the "DEEPGRAM_API_KEY" environment variable
var deepgramClient = new ListenRESTClient();
var customOptions = new Dictionary<string, string>();
customOptions["smart_format"] = "true";
var response = await deepgramClient.TranscribeUrl(
new UrlSource("https://dpgr.am/bueller.wav"),
new PreRecordedSchema()
{
Model = "nova-2",
},
null, // use the default timeout
customOptions);
Console.WriteLine(response);
Console.ReadKey();
// Teardown Library
Library.Terminate();
}
}
}