Skip to content

Using C# .NET to detect .ogg vorbis file properties

Recently I needed to read the various audio file properties of a .ogg Vorbis file for further processing. I wanted to be able to read these properties from managed C# code. I was not able to find a clear example online for doing this (even StackOverflow failed me). After a bit of scrounging online, I eventually arrived at a library that could do this: Vorbis .NET . Unfortunately, their documentation was dead and their example program error-ed out where I ran it, so I went ahead and started exploring it.

The relevant line of code needed was (after adding references to Vorbit .NET of course):
var x = OggVorbisDecoder.OggVorbisMemoryStream.LoadFromFile(_fullOggFilePath);.
This provided access to a VorbisInfo property which had the following attributes:

  • BitrateLower
  • BitrateNominal
  • BitrateUpper
  • Channels
  • Rate
  • Version

I have attached my source and an example program.
Ogg Vorbis Info Demo Source Only
Ogg Vorbis Info Demo Binary Only

1 thought on “Using C# .NET to detect .ogg vorbis file properties”

  1. hi-
    i visited your website and i am in need of help. hopefully you can help me out or put me in contact with someone who can.
    i have a bunch of videos. i want to extract the MP3 and then (here is the hard part for me) insert the MP3 file into a speech to text program that will
    transcribe the MP3 (or WAV if need be, etc.) voice file into a text file.
    if you would be willing to create one for me please let me know the cost to create it.
    thanks so much for your time.
    mike

Leave a Reply

Your email address will not be published. Required fields are marked *