Skip to content

Instantly share code, notes, and snippets.

@moumar
Created January 7, 2011 15:13
Show Gist options
  • Select an option

  • Save moumar/769573 to your computer and use it in GitHub Desktop.

Select an option

Save moumar/769573 to your computer and use it in GitHub Desktop.
# 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