![]() |
Multimedia »
Audio and Video »
Audio
Intermediate
License: The GNU Lesser General Public License
Assembly to Read and Write Ogg Tags (Vorbis, FLAC and Speex)By Cyber SinhAn article discussing an assembly that reads and writes Ogg tags |
C# 2.0, Windows, .NET 2.0VS2005, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
For my freeware project, MetatOGGer, I needed a managed library to read and write tags contained in Ogg and FLAC streams. As I couldn't find any, I decided to write one myself.
The codecs supported by this library include Vorbis, FLAC and Speex. Technical information about Ogg and FLAC files can also be gotten using this library.
Text tags will be stored in a SortedList<string, List<string>> because you can have several identical tags such as "artist," etc. Picture tags will be stored in a collection of ID3PictureFrame with a BitmapFrame property (Windows Imaging Component).
It's possible to read any raw data in an Ogg stream with the OggPageReader class.
The use of OggTagger and FlacTagger is very easy. The source code is fully documented (in French). Here is the diagram for main classes:
using Luminescence.Xiph;
OggTagger ogg = new OggTagger(@"C:\Song.ogg");
// Load duration
DateTime time = new DateTime(0);
time = time.AddSeconds(ogg.Duration);
// Tags manipulation
string artist = ogg.Artist;
ogg.Title = "Creep";
SortedList<string, List<string>> tags = ogg.GetAllTags();
BitmapFrame cover = ogg.FlacArts[0].Picture;
ClearNonOfficialTag() method doesn't throw exceptions OutOfMemory exception could be thrown while reading some FLAC files) VorbisComment is now an abstract class) CheckedVorbisCommentKey(string) in VorbisComment class OggPage and OggPageReader for reading data in Ogg streams ID3PictureFrame) | You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 24 Apr 2009 Editor: Deeksha Shenoy |
Copyright 2006 by Cyber Sinh Everything else Copyright © CodeProject, 1999-2009 Web19 | Advertise on the Code Project |