-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (32 loc) · 1.26 KB
/
Copy pathProgram.cs
File metadata and controls
42 lines (32 loc) · 1.26 KB
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
using System;
using System.Threading.Tasks;
using SayIt;
namespace SayIt.Samples.AdvancedConfig
{
class Program
{
static async Task Main(string[] args)
{
var text = args.Length > 0 ? args[0]
: "Welcome to SayIt! You can control rate, pitch, and volume.";
var normal = new SayItConfig()
.WithVoice(VoiceId.EnUSJennyNeural);
var fast = normal.WithRate("+50%");
var slowDeep = normal
.WithRate("-30%")
.WithPitch("-4st");
var whisper = normal
.WithRate("-20%")
.WithVolume("30%");
Console.WriteLine("1. Normal rate -> normal.mp3");
await SayIt.SaveAsync(text, "normal.mp3", normal);
Console.WriteLine("2. Fast (+50%) -> fast.mp3");
await SayIt.SaveAsync(text, "fast.mp3", fast);
Console.WriteLine("3. Slow & deep (-30%, -4st) -> slow_deep.mp3");
await SayIt.SaveAsync(text, "slow_deep.mp3", slowDeep);
Console.WriteLine("4. Whisper (-20%, 30% volume) -> whisper.mp3");
await SayIt.SaveAsync(text, "whisper.mp3", whisper);
Console.WriteLine("All done! Compare the files.");
}
}
}