func DetectFormat(h []byte) Format {
	for _, p := range prefixTable {
		l := len(p.prefix)
		if len(h) > l && bytes.Equal(h[:l], p.prefix) {
			return p.format
		}
	}
	return UnsupportedFormat
}
DetectFormat takes the header of a file and tries to determine what
kind of audio format the file contains. The returned value is a typed
string containing the format name.

Returns UnsupportedFormat if the format is not known or unsupported
package audec
import "bytes"
type Format string
type pre struct {
	prefix []byte
	format Format
}
var prefixTable = []pre{
	{[]byte("fLaC\x00\x00\x00"), FLAC},
	{[]byte{0x49, 0x44, 0x33}, MP3},  
	{[]byte{0xFF, 0xFB}, MP3},  
	{[]byte{0xFF, 0xFA}, MP3},  
	{[]byte{0xFF, 0xF3}, MP3},  
	{[]byte{0xFF, 0xF2}, MP3},  
	{[]byte{0xFF, 0xE3}, MP3},  
	{[]byte{0xFF, 0xE2}, MP3},  
	{[]byte("\x4F\x67\x67\x53\x00"), OGG},
}
const (
	UnsupportedFormat Format = ""
	MP3                      = "MP3"
	FLAC                     = "FLAC"
	OGG                      = "OGG"
)