OggSong class takes a stream which is an ogg file. The ogg file must be mono or stereo. More than 2 channels is not supported.

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();

// if you want to just decode an ogg file and play it or save it some other way, use the OggDecoder class.

Last edited Jan 15, 2012 at 9:15 PM by jjxtra, version 7

Comments

jjxtra Apr 6, 2012 at 1:33 AM 
Added a fix to let ogg files load faster if random seeking is not necessary

jjxtra Jan 16, 2012 at 8:30 PM 
Just checked in new changes that add new properties

jjxtra Jan 13, 2012 at 9:09 PM 
I'm working on exposing position and length of OggSong in seconds as well as allowing for increasing the play speed. Stay tuned!