Skip to content

Instantly share code, notes, and snippets.

@ArcticEcho
Created September 9, 2014 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArcticEcho/d28196d8e610b84399fa to your computer and use it in GitHub Desktop.
Save ArcticEcho/d28196d8e610b84399fa to your computer and use it in GitHub Desktop.
private static IEnumerable<WavFileRead> GetChannels(string directory)
{
var files = Enum.GetValues(typeof(Channels)).Cast<Channels>().Where(channel => channel != Channels.Custom && channel != Channels.Mono).Select(channel => Path.Combine(directory, channel.GetFriendlyName() + ".wav")).Where(File.Exists).Select(path => new WavFileRead(path)).ToList();
files.AddRange(Directory.EnumerateFiles(directory).Where(fileName => fileName.Contains(Channels.Mono.GetFriendlyName()) || fileName.Contains(Channels.Custom.GetFriendlyName())).Select(file => new WavFileRead(file)));
return files;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment