Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Parse a folder of MP3.

  • Loading branch information...
commit e34d5ae3362667d3b389287a773708e3c38242f4 1 parent e4d7b0c
Mathieu Lecarme authored

Showing 2 changed files with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 1 bin/terasound
  2. +5 2 lib/terasound/echoprint.rb
4 bin/terasound
@@ -2,4 +2,6 @@
2 2
3 3 require "terasound/echoprint"
4 4
5   -p TeraSound.codegen ARGV[0]
  5 +TeraSound.codegen(ARGV[0]) do |mp3|
  6 + p mp3
  7 +end
7 lib/terasound/echoprint.rb
@@ -2,8 +2,11 @@
2 2
3 3 module TeraSound
4 4
5   - def TeraSound.codegen path
6   - JSON.parse `find #{path} -name "*.mp3" | echoprint-codegen -s 10 30`
  5 + # Parse a folder and extract mp3 data
  6 + def TeraSound.codegen path, &block
  7 + Dir["#{path}/**/*.mp3"].each do |mp3|
  8 + yield JSON.parse(`echoprint-codegen "#{mp3}" 10 30`)[0]
  9 + end
7 10 end
8 11
9 12 end

0 comments on commit e34d5ae

Please sign in to comment.
Something went wrong with that request. Please try again.