id3lib-ruby utf16
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'id3lib' | |
require "kconv" | |
class MyID3Tag < ID3Lib::Tag | |
def title=(v) | |
self.set_frame_text(:TIT2, v.toutf16) | |
self.frame(:TIT2)[:textenc] = 1 | |
end | |
def album=(v) | |
self.set_frame_text(:TALB, v.toutf16) | |
self.frame(:TALB)[:textenc] = 1 | |
end | |
def artist=(v) | |
self.set_frame_text(:TPE1, v.toutf16) | |
self.frame(:TPE1)[:textenc] = 1 | |
end | |
end | |
tag = MyID3Tag.new('orig.mp3', ID3Lib::V_ALL) | |
tag.title = "たいとる" | |
tag.album="あるばむ" | |
tag.artist="あーちすと" | |
tag.track = '5/13' | |
tag.update! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment