Project Description
*** This project is deprecated, use NVorbis: https://nvorbis.codeplex.com/ ***


OggSharp allows decoding / playing OGG files using pure C# WITHOUT PInvoke.

Even if you are not using XNA, you can still use the ogg decoder to get raw PCM data.

Example:
OggSong menuMusic = new OggSong(TitleContainer.OpenStream("Content/Music/MainMenuMusic.ogg"));
menuMusic.Play();
menuMusic.Pitch = 1.0f; // speed it up!
menuMusic.Pan = 0.1f; // move it from left to right speakers
float lengthInSeconds = menuMusic.Length; // how many seconds long is this song?
float position = menuMusic.Position; // where in the song are we?
menuMusic.Position = 5.0f; // seek 5 seconds into the song

// for sound effects, does not support playing multiple simultaneous times with the same OggSong yet...
OggSong explosion = new OggSong(TitleContainer.OpenStream("Content/Sounds/Explosion.ogg"));
explosion.Play();

Note much of this code is taken from the csvorbis code that was taken from JVorbis.
See more: https://github.com/mono/csvorbis

Last edited Feb 9, 2013 at 5:00 PM by jjxtra, version 13