0

When I load and play a ogg file I hear sound no problem. When I change no code and specify a file that ends with mp3 I get an SdlException "Unrecognized sound file type". The autocomplete text says it supports wave, mp3, ogg and others but it appears it isn't supporting mp3. I tried more then one mp3 file.

How do I load mp3s? Here is my quick test code in a winform app

Video.SetVideoMode(320, 240, 32, false, false, false, true);
//var s = new Sound(@"a.ogg");
var s = new Sound(@"a.mp3");
Task.Run(() =>
{
    var c = s.Play();
    //System.Threading.Thread.Sleep(3000);
    Task.Delay(3000).Wait();
    c.Pause();
    System.Threading.Thread.Sleep(500);
    c.Resume();
    //s.Stop();
});

1 Answers1

0

In the official documentation says:

"SDL.NET does not support MP3 format because the underlying C library, SDL_mixer, does not officially support it"

Source http://sourceforge.net/apps/mediawiki/cs-sdl/index.php?title=Audio

SDL Mixer (if you like implement) http://www.libsdl.org/projects/SDL_mixer/

Hernaldo Gonzalez
  • 1,977
  • 1
  • 21
  • 32