Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Parse a folder of MP3.
Browse files Browse the repository at this point in the history
  • Loading branch information
athoune committed Oct 28, 2011
1 parent e4d7b0c commit e34d5ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/terasound
Expand Up @@ -2,4 +2,6 @@

require "terasound/echoprint"

p TeraSound.codegen ARGV[0]
TeraSound.codegen(ARGV[0]) do |mp3|
p mp3
end
7 changes: 5 additions & 2 deletions lib/terasound/echoprint.rb
Expand Up @@ -2,8 +2,11 @@

module TeraSound

def TeraSound.codegen path
JSON.parse `find #{path} -name "*.mp3" | echoprint-codegen -s 10 30`
# Parse a folder and extract mp3 data
def TeraSound.codegen path, &block
Dir["#{path}/**/*.mp3"].each do |mp3|
yield JSON.parse(`echoprint-codegen "#{mp3}" 10 30`)[0]
end
end

end

0 comments on commit e34d5ae

Please sign in to comment.