Distinguish between M4{A,B,P} formats.
Note: Removes tag.AAC.
This commit is contained in:
@@ -26,8 +26,20 @@ func Identify(r io.ReadSeeker) (format Format, fileType FileType, err error) {
|
||||
case string(b[0:4]) == "OggS":
|
||||
return VORBIS, OGG, nil
|
||||
|
||||
case string(b[4:11]) == "ftypM4A":
|
||||
return AAC, MP4, nil
|
||||
case string(b[4:8]) == "ftyp":
|
||||
b = b[8:11]
|
||||
fileType = UnknownFileType
|
||||
switch string(b) {
|
||||
case "M4A":
|
||||
fileType = M4A
|
||||
|
||||
case "M4B":
|
||||
fileType = M4B
|
||||
|
||||
case "M4P":
|
||||
fileType = M4P
|
||||
}
|
||||
return MP4, fileType, nil
|
||||
|
||||
case string(b[0:3]) == "ID3":
|
||||
b := b[3:]
|
||||
|
||||
Reference in New Issue
Block a user