Programming · TagLib#

TagLib#: Fire good, Ogg happy

I tagged this myself!

$ mono ReadFromUri.exe mac_pc_linux_2.OGG 
Title:      Second Novell "I'm a mac..." parody ad
Artists:    Novell
Year:       2007
Track:      2
TrackCount: 0
Disc:       0
DiscCount:  0
Audio Properties
Bitrate:    56
SampleRate: 22050
Channels:   2
Length:     00:00:41.9000000
Embedded Pictures: 0

What I ended up doing is, on Save(), reading the OGG structure in an identical manner to the initial Read() (minus scanning to the end for duration information). Along the way, I store all the Pages I’ve collected, and by the end of the “Read”, I’ll have read all the way to the end of the taggable region. Then I dump the pages into stream specific Paginators which separate the pages into packets. After that, I take the stream specific XiphComments and use the appropriate codec to stick it in the packet collection. Then, all I need to do is Paginate (which could use some improvement), shuffle the pages back together, and insert the chunk where the old packets used to be. Wow, that could have been a lot clearer.

But anyway, the code is now in subversion: and if haven’t yet seen it, see “Blades of Glory”. It is not just Will Farrell’s funniest movie (which isn’t saying much) but it’s the funniest movie I’ve seen in a long time. I haven’t laughed out loud like this in a movie theatre since opening night of Episode III, and this one was actually supposed to be funny (but had significantly less gay innuendo)!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s