DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Stripping Tag Information From MP3 Files [For Win32] - Ruby

11.10.2010
| 1741 views |
  • submit to reddit
        
require 'rubygems'
require 'id3lib'

fnames = []
record  = `dir /b /S *.mp3`.chomp!
fnames = record.split("\n")

count = 0
num = 0
while (count < fnames.size)
	# Load a tag from a file
	tag = ID3Lib::Tag.new("#{fnames[count]}")

	# Get and set text frames with convenience methods

	#if (tag.album == "The Lion King: 1997 Broadway Cast")
	tag.strip!
	puts "."
	num +=1
	count += 1
end

puts "Modified #{num} Records."