1#ifndef FILETYPE_TYPES_AUDIO_TYPES_HPP
2#define FILETYPE_TYPES_AUDIO_TYPES_HPP
6#include "filetype/type.hpp"
10using Type = ::filetype::Type;
18inline const std::array<uint8_t, 2> MP3_MAGIC = {0xFF, 0xFB};
19inline const std::array<uint8_t, 3> MP3_ID3_MAGIC = {0x49, 0x44, 0x33};
20inline const Type TYPE_MP3{
"audio/mpeg",
"mp3"};
24inline const std::array<uint8_t, 12> WAV_MAGIC = {
25 0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45};
26inline const Type TYPE_WAV{
"audio/wav",
"wav"};
30inline const std::array<uint8_t, 4> MIDI_MAGIC = {0x4D, 0x54, 0x68, 0x64};
31inline const Type TYPE_MIDI{
"audio/midi",
"mid"};
35inline const std::array<uint8_t, 4> FLAC_MAGIC = {0x66, 0x4C, 0x61, 0x43};
36inline const Type TYPE_FLAC{
"audio/flac",
"flac"};
40inline const std::array<uint8_t, 2> AAC_MAGIC = {0xFF, 0xF1};
41inline const Type TYPE_AAC{
"audio/aac",
"aac"};
45inline const std::array<uint8_t, 4> OGG_MAGIC = {0x4F, 0x67, 0x67, 0x53};
46inline const Type TYPE_OGG{
"audio/ogg",
"ogg"};
50inline const std::array<uint8_t, 8> WMA_MAGIC = {0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11};
51inline const Type TYPE_WMA{
"audio/x-ms-wma",
"wma"};
55inline const std::array<uint8_t, 12> AIFF_MAGIC = {
56 0x46, 0x4F, 0x52, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x41, 0x49, 0x46, 0x46};
57inline const Type TYPE_AIFF{
"audio/aiff",
"aiff"};
61inline const std::array<uint8_t, 12> M4A_MAGIC = {
62 0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41, 0x20};
63inline const Type TYPE_M4A{
"audio/mp4",
"m4a"};