-
Notifications
You must be signed in to change notification settings - Fork 4
/
ClassifierDemo.cs
28 lines (26 loc) · 964 Bytes
/
ClassifierDemo.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
using System;
using csharp_deep_learning_audio;
using System.IO;
namespace csharp_deep_learning_audio_samples
{
public class ClassifierDemo
{
public static void Demo()
{
AudioClassifier c = new AudioClassifier();
string dataDirPath = Path.Combine(IOUtils.AssemblyDirectory, "..", "..", "..", "..", "gtzan", "genres");
string[] subDirectories = Directory.GetDirectories(dataDirPath);
foreach (string subDirectory in subDirectories)
{
string[] files = Directory.GetFiles(subDirectory, "*.au");
foreach (string file in files)
{
Console.WriteLine("Processing: {0}", file);
Console.WriteLine("Encoded Audio: {0}", c.EncodeAudio(file));
Console.WriteLine("predicted: {0}", c.PredictLabel(file));
break;
}
}
}
}
}