# Path: chirp/common/id3_header.py
# def _create_text_frame(frame_tag, value):
# def create(tag_list):
# def parse_size(data, offset=0):
# def find_size(data):
# def create_test_header(size):
# 
# Path: chirp/common/mp3_header.py
# STEREO = 0
# JOINT_STEREO = 1
# DUAL_MONO = 2
# MONO = 3
# _CHANNELS_TO_STR = {
#     STEREO: 'stereo',
#     JOINT_STEREO: 'joint_stereo',
#     DUAL_MONO: 'dual_mono',
#     MONO: 'mono',
#     None: None,
# }
# _PROTECTED_TABLE = (True, False)
# _BIT_RATE_KBPS_TABLE = (0, 32, 40, 48, 56, 64, 80, 96,
#                         112, 128, 160, 192, 224, 256, 320)
# _SAMPLING_RATE_HZ_TABLE = (44100, 48000, 32000)
# _PADDING_TABLE = (False, True)
# _SAMPLES_PER_FRAME = 1152
# def _match_eq(x, y):
#     def __init__(self, sampling_rate_hz=None, bit_rate_kbps=None,
#                  channels=None, protected=None, padding=None):
#     def is_complete(self):
#     def match(self, hdr):
#     def __str__(self):
# def parse(data, offset=0):
# def find(data, expected_hdr=None):
# def from_mutagen(mutagen_mp3):
# class MP3Header(object):


from chirp.common import id3_header
from chirp.common import mp3_header

# This is a 44.1Khz, 112Kbps joint stereo MPEG frame of digitized
# silence.  It was produced by sampling from a Barix with no active
# input.  Like any 44.1Khz MPEG frame, it has a duration of
# 26.12245ms.
_DEAD_AIR_DATA = (
    "\xff\xfa\x80\x48\x80\x3d\x00\x00\x02\x5f\x09\x4f\x79\x26\x31\x20"
    "\x4b\x81\x29\xcf\x24\xc2\x24\x09\x94\x23\x3f\xe3\x18\x44\x81\x1f"
    "\x84\x67\x3c\x92\x8c\x90\x8b\xbb\xab\xaa\x77\x6d\x76\x91\xb4\x54"
    "\x46\x74\x4e\xa8\xa1\x57\x75\x20\xa3\x8b\x98\xb3\x1e\xd1\xea\x78"
    "\x71\x86\xd2\x6d\x49\x71\x93\x93\x91\x45\xaa\x38\x73\xe2\xab\x26"
    "\xd8\xe9\xed\xa1\x0b\xb5\xc5\x6f\x36\xb6\x9f\x16\xba\xc4\x8a\x9e"
    "\x26\x7d\x75\x54\xf5\xa7\x2c\xb6\x1c\x41\x8a\x75\xf6\xb2\x0d\xac"
    "\x06\x2e\xd3\x55\x53\x30\xec\xb6\x59\x23\x44\x4b\x4f\x9a\x0f\x1a"
    "\x07\x03\x22\x38\xf1\xa1\xc3\x80\xc8\x25\x81\xe2\xe8\x11\x15\x87"
    "\x25\xf2\xeb\x4e\x31\xfd\x41\x6a\xa2\xf5\x20\x28\xbb\x07\x10\x0d"
    "\xac\xdb\xcb\x29\xe9\x1f\xd8\x86\xd6\xfa\x48\xe8\x1a\xa8\x9a\xeb"
    "\x90\xe1\xe7\x9e\x28\xe3\xe8\x15\x2f\xc0\x8f\xa5\x22\xd1\x79\x95"
    "\x75\x50\xcf\xbe\xda\xd8\xcd\x70\x00\xd0\x12\xc0\x21\x41\xc4\xa2"
    "\x40\xf1\x9c\x10\x9c\x12\xd8\x2a\x94\xcc\xa4\x09\x6c\xe9\x7a\x98"
    "\xe6\x15\x06\x5e\x96\xcf\x2b\xd6\xb6\xbb\x16\x68\xd4\xa5\xa2\xdc"
    "\x4f\x31\x02\xf4\x91\x50\x49\x4f\x58\xc2\xf3\xa6\x49\x0a\xb0\x3f"
    "\x1e\x2f\xdd\x7a\xca\x3d\xc3\x03\x54\x1b\x6a\xa9\x0a\x97\x74\x49"
    "\x24\xb1\xa2\x2b\x8e\x09\x08\x15\x81\xb1\xc4\x02\x82\x44\xa1\x30"
    "\x10\xc4\x21\xe5\x92\xb9\xfa\x49\xa0\x9a\xec\xf5\xbc\x51\x62\xe3"
    "\xd3\x60\x55\xac\x78\x77\x27\x4d\xe6\xda\x80\x71\x76\x54\x93\x2f"
    "\x52\xe0\x0f\xa9\xee\xb1\x54\x86\x0b\x2d\xf6\xd5\x53\x9a\x2d\x9c"
    "\x72\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")


# Path: chirp/common/id3_header.py
# def _create_text_frame(frame_tag, value):
# def create(tag_list):
# def parse_size(data, offset=0):
# def find_size(data):
# def create_test_header(size):
# 
# Path: chirp/common/mp3_header.py
# STEREO = 0
# JOINT_STEREO = 1
# DUAL_MONO = 2
# MONO = 3
# _CHANNELS_TO_STR = {
#     STEREO: 'stereo',
#     JOINT_STEREO: 'joint_stereo',
#     DUAL_MONO: 'dual_mono',
#     MONO: 'mono',
#     None: None,
# }
# _PROTECTED_TABLE = (True, False)
# _BIT_RATE_KBPS_TABLE = (0, 32, 40, 48, 56, 64, 80, 96,
#                         112, 128, 160, 192, 224, 256, 320)
# _SAMPLING_RATE_HZ_TABLE = (44100, 48000, 32000)
# _PADDING_TABLE = (False, True)
# _SAMPLES_PER_FRAME = 1152
# def _match_eq(x, y):
#     def __init__(self, sampling_rate_hz=None, bit_rate_kbps=None,
#                  channels=None, protected=None, padding=None):
#     def is_complete(self):
#     def match(self, hdr):
#     def __str__(self):
# def parse(data, offset=0):
# def find(data, expected_hdr=None):
# def from_mutagen(mutagen_mp3):
# class MP3Header(object):


# Path: chirp/common/mp3_frame.py
from chirp.common import id3_header
from chirp.common import mp3_header


# This is a 44.1Khz, 112Kbps joint stereo MPEG frame of digitized
# silence.  It was produced by sampling from a Barix with no active
# input.  Like any 44.1Khz MPEG frame, it has a duration of
# 26.12245ms.
_DEAD_AIR_DATA = (
    "\xff\xfa\x80\x48\x80\x3d\x00\x00\x02\x5f\x09\x4f\x79\x26\x31\x20"
    "\x4b\x81\x29\xcf\x24\xc2\x24\x09\x94\x23\x3f\xe3\x18\x44\x81\x1f"
    "\x84\x67\x3c\x92\x8c\x90\x8b\xbb\xab\xaa\x77\x6d\x76\x91\xb4\x54"
    "\x46\x74\x4e\xa8\xa1\x57\x75\x20\xa3\x8b\x98\xb3\x1e\xd1\xea\x78"
    "\x71\x86\xd2\x6d\x49\x71\x93\x93\x91\x45\xaa\x38\x73\xe2\xab\x26"
    "\xd8\xe9\xed\xa1\x0b\xb5\xc5\x6f\x36\xb6\x9f\x16\xba\xc4\x8a\x9e"
    "\x26\x7d\x75\x54\xf5\xa7\x2c\xb6\x1c\x41\x8a\x75\xf6\xb2\x0d\xac"
    "\x06\x2e\xd3\x55\x53\x30\xec\xb6\x59\x23\x44\x4b\x4f\x9a\x0f\x1a"
    "\x07\x03\x22\x38\xf1\xa1\xc3\x80\xc8\x25\x81\xe2\xe8\x11\x15\x87"
    "\x25\xf2\xeb\x4e\x31\xfd\x41\x6a\xa2\xf5\x20\x28\xbb\x07\x10\x0d"
    "\xac\xdb\xcb\x29\xe9\x1f\xd8\x86\xd6\xfa\x48\xe8\x1a\xa8\x9a\xeb"
    "\x90\xe1\xe7\x9e\x28\xe3\xe8\x15\x2f\xc0\x8f\xa5\x22\xd1\x79\x95"
    "\x75\x50\xcf\xbe\xda\xd8\xcd\x70\x00\xd0\x12\xc0\x21\x41\xc4\xa2"
    "\x40\xf1\x9c\x10\x9c\x12\xd8\x2a\x94\xcc\xa4\x09\x6c\xe9\x7a\x98"
    "\xe6\x15\x06\x5e\x96\xcf\x2b\xd6\xb6\xbb\x16\x68\xd4\xa5\xa2\xdc"
    "\x4f\x31\x02\xf4\x91\x50\x49\x4f\x58\xc2\xf3\xa6\x49\x0a\xb0\x3f"
    "\x1e\x2f\xdd\x7a\xca\x3d\xc3\x03\x54\x1b\x6a\xa9\x0a\x97\x74\x49"
    "\x24\xb1\xa2\x2b\x8e\x09\x08\x15\x81\xb1\xc4\x02\x82\x44\xa1\x30"
    "\x10\xc4\x21\xe5\x92\xb9\xfa\x49\xa0\x9a\xec\xf5\xbc\x51\x62\xe3"
    "\xd3\x60\x55\xac\x78\x77\x27\x4d\xe6\xda\x80\x71\x76\x54\x93\x2f"
    "\x52\xe0\x0f\xa9\xee\xb1\x54\x86\x0b\x2d\xf6\xd5\x53\x9a\x2d\x9c"
    "\x72\x90\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")


_DEAD_AIR_DURATION_MS = mp3_header._SAMPLES_PER_FRAME / 44.1