# 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
                try:
                    next_block = block_iter.next()
                except StopIteration:
                    at_end_of_stream = True
                    break
                buffered_list.append(next_block)
                buffered_size += len(next_block)
            buffered = ''.join(buffered_list)

        # Are we at the end of the file?  If so, break out of the
        # "while True:" loop
        if not buffered:
            break

        # Do we have an MP3 header?  If so, yield the frame and then
        # slice it off of our buffer.
        if current_hdr:
            current_frame = buffered[:current_hdr.frame_size]
            # If we found a full-length frame, yield it.  Otherwise
            # return the truncated frame as junk.  (We can be sure not
            # to throw away a valid frame since we buffer at least the
            # next _READ_SIZE bytes, and _READ_SIZE is larger than any
            # possible MP3 frame.
            if len(current_frame) != current_hdr.frame_size:
                current_hdr = None
            yield current_hdr, current_frame
            current_hdr = None
            buffered = buffered[len(current_frame):]

        # Look for the next ID3 header.

# 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

                try:
                    next_block = block_iter.next()
                except StopIteration:
                    at_end_of_stream = True
                    break
                buffered_list.append(next_block)
                buffered_size += len(next_block)
            buffered = ''.join(buffered_list)

        # Are we at the end of the file?  If so, break out of the
        # "while True:" loop
        if not buffered:
            break

        # Do we have an MP3 header?  If so, yield the frame and then
        # slice it off of our buffer.
        if current_hdr:
            current_frame = buffered[:current_hdr.frame_size]
            # If we found a full-length frame, yield it.  Otherwise
            # return the truncated frame as junk.  (We can be sure not
            # to throw away a valid frame since we buffer at least the
            # next _READ_SIZE bytes, and _READ_SIZE is larger than any
            # possible MP3 frame.
            if len(current_frame) != current_hdr.frame_size:
                current_hdr = None
            yield current_hdr, current_frame
            current_hdr = None
            buffered = buffered[len(current_frame):]

        # Look for the next ID3 header.

        id3_size, id3_offset = id3_header.find_size(buffered)