Added mozart and a project
This commit is contained in:
34
SoundHandler.cs
Normal file
34
SoundHandler.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Mozart
|
||||
{
|
||||
public class SoundHandler
|
||||
{
|
||||
public async Task PlayAudioAsync(string path)
|
||||
{
|
||||
var process = Process.Start("paplay", path);
|
||||
|
||||
await process.WaitForExitAsync();
|
||||
}
|
||||
|
||||
public string getPath(Instrument instrument, SoundType type, int i, int s)
|
||||
{
|
||||
var currentDirectory = Directory.GetCurrentDirectory();
|
||||
var path = Path.Join(currentDirectory, "Data", instrument.ToString(), type.ToString() + i + "-" + s + ".wav");
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Instrument
|
||||
{
|
||||
clarinet,
|
||||
flute_harp,
|
||||
mbira,
|
||||
piano
|
||||
}
|
||||
public enum SoundType {
|
||||
minuet,
|
||||
trio
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user