65.9K
CodeProject is changing. Read more.
Home

Read tags of .ogg files

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.73/5 (6 votes)

Jul 13, 2004

viewsIcon

38393

downloadIcon

913

A simple class that reads default tags of ogg vorbis files.

Introduction

This is a simple class that reads default tags (the ones suggested by xiph.org) and the common "COMMENT" tag used by WinAmp and other players and tag editors.

How it works

The code is enough documented to understand what it does, so take a look at it. Basically, it reads a groups of four bytes, converts them into string, and checks if a tag name starts with that four letters. If so, it reads the whole tag name and if it is a valid one, fills the correspondent string property with the tag value. Then it moves to the next byte...

Using the code

Simply add reference to oggReader.dll into your project and create a new instance of the class OggReader. The string parameter must be the absolute or relative path of the ogg file. Tags will be available as string properties.

JockerSoft.OggReader myOggReader = 
       new JockerSoft.OggReader("c:\temp\oggfile.ogg");

this.textBoxTitle.Text = myOggReader.Title;