File is Audio file #102
Darren2k34
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Heya, Thanks for your interest in this library ! You may find inspiration for your use case there : ( Let me know if that's what you need. Cheers, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, firstly this library is pretty cool :)
I'm currently building an app to help me manage my audio files, and I came across this library to help me get the meta data, which I use to populate my model ( WPF ).
One of the functions in my app is to load all * audio * files in the selected directory, I couldn't really find a simple to implement way on the internet to check if a file is an audio file file or not. One suggestion was to compare the extention, but I didn't really like this approach, another talked about MIDI but I don't know what that is. So.. I began to see if I could find one with your library.
My solution is a static method as follows:
`
public static bool IsFileAudioFile(string path )
{
if ( string.IsNullOrWhiteSpace( path ) || !File.Exists(path))
return false;
`
Really what I think this method achieves is to check if the file is a supported type ( I think o.o ) and this method seems to work, I honestly don't know if this is a good usecase for AudioFormat thingy I know very little about audio, I just noticed that it returns -1 when i tried loading a text file into it.
Do you have something that achieves the same result already? Or could you please implement something more elegant?
Ideally it would be great to have a method that returns true if the file is an audio file, OR just a method that returns true if the file is a supported file ( audio that can be read etc ), OR both.
Hope this gets implemented into the library. :)
Beta Was this translation helpful? Give feedback.
All reactions