]> git.tdb.fi Git - libs/al.git/blobdiff - source/sounddecoder.cpp
Add support for MP3 files using libmad
[libs/al.git] / source / sounddecoder.cpp
index a2cd51af4624154cca52312157cfb18f31a9b21e..38ae8fa15b77635e360ee50d313345eee6edb37b 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/core/refptr.h>
 #include <msp/io/file.h>
 #include <msp/strings/format.h>
+#include "mp3decoder.h"
 #include "oggdecoder.h"
 #include "sounddecoder.h"
 
@@ -42,6 +43,8 @@ SoundDecoder *SoundDecoder::open_io(IO::Seekable &io)
        string signature(sig_buf, sizeof(sig_buf));
        if(OggDecoder::detect(signature))
                return new OggDecoder(io);
+       else if(Mp3Decoder::detect(signature))
+               return new Mp3Decoder(io);
        else
        {
                string sig_hex;