Skip to content

Instantly share code, notes, and snippets.

@ChristopherMacGown
Created November 12, 2010 08:42
Show Gist options
  • Select an option

  • Save ChristopherMacGown/673875 to your computer and use it in GitHub Desktop.

Select an option

Save ChristopherMacGown/673875 to your computer and use it in GitHub Desktop.
chris@christopher-macgowns-macbook-pro:~ $ ls -alh ~/Music/iTunes/iTunes\ Music/Iio/Rapture/Rapture\ \(Armin\ van\ Buuren\ Remix\).mp3
-rw-r--r-- 1 chris staff 12M Feb 1 2010 /Users/chris/Music/iTunes/iTunes Music/Iio/Rapture/Rapture (Armin van Buuren Remix).mp3
>> audio_file = "/Users/chris/Music/iTunes/iTunes Music/Iio/Rapture/Rapture (Armin van Buuren Remix).mp3"
>> (bytes = IO.read(audio_file).unpack("s*")) and nil
>> puts bytes.length
>> t = Time.now().utc
>> puts bytes.each_slice(2).to_a.transpose.length
>> puts Time.now().utc - t
4.148601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment