Created
January 7, 2011 15:13
-
-
Save moumar/769573 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # test whether +path+ is a valid and supported audiofile | |
| def is_audio_file?(path) | |
| begin | |
| AudioInfo.new(path) rescue false | |
| return true | |
| rescue AudioInfoError | |
| return false | |
| end | |
| end | |
| def audio_type(path) | |
| File.extname(path)[1..-1] | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment