+ char sig_buf[8];
+ io.read(sig_buf, sizeof(sig_buf));
+ string signature(sig_buf, sizeof(sig_buf));
+ if(OggDecoder::detect(signature))
+ return new OggDecoder(io);
+ else
+ {
+ string sig_hex;
+ for(unsigned i=0; i<sizeof(sig_buf); ++i)
+ {
+ if(i)
+ sig_hex += ' ';
+ sig_hex += Msp::format("%02X", static_cast<unsigned char>(sig_buf[i]));
+ }
+ throw unsupported_sound(sig_hex);
+ }