Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C#
Article

Read tags of .ogg files

Rate me:
Please Sign up or sign in to vote.
4.73/5 (6 votes)
12 Jul 2004 37.8K   913   15   5
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.

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

this.textBoxTitle.Text = myOggReader.Title;

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Italy Italy

Comments and Discussions

 
QuestionOggReader Pin
jfriedman13-Dec-14 2:51
jfriedman13-Dec-14 2:51 
Https://net7mma.codeplex.com has a OggReader which is compatible with Ogm variation as well as the standard xiph.org version.

There is also support for most other digital container formats as well as Rtp and Rtsp support.
QuestionShould it also work for FLAC? Pin
Alan Hope3-Nov-13 2:44
Alan Hope3-Nov-13 2:44 
GeneralFantastic Pin
[ICR]3-Jul-06 9:42
[ICR]3-Jul-06 9:42 
Generalgreat script - little bug Pin
Sean1234123419-Aug-05 12:58
sussSean1234123419-Aug-05 12:58 
GeneralRe: great script - little bug Pin
JockerSoft19-Aug-05 19:09
JockerSoft19-Aug-05 19:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.