Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Get size.

:param mpeg_version: Version of the MPEG, as returned by 
    :func:`get_mpeg_version`
:type mpeg_version: string

:param layer: Layer of the MPEG as returned by :func:`get_layer`.
:type layer: string

:param sample_rate: Sampling rate in Hz.(more...)

        def get_frame_size(mpeg_version, layer, sample_rate, bitrate, padding_size):
    """Get size.
    
    :param mpeg_version: Version of the MPEG, as returned by 
        :func:`get_mpeg_version`
    :type mpeg_version: string
    
    :param layer: Layer of the MPEG as returned by :func:`get_layer`.
    :type layer: string
    
    :param sample_rate: Sampling rate in Hz.
    :type sample_rate: int
    
    :param bitrate: Bitrate in kilobits per second.
    :type bitrate: int
    
    :param padding_size: Size of header padding. Always either ``1`` or ``0``.
    :type padding_size: int
    
    :return: Frame size in bytes.
    :rtype: int
    
    :raise mpeg1audio.MPEGAudioHeaderException: Raised when frame size cannot be 
        determined.
    
    """
    try:
        coeff = SLOT_COEFFS[mpeg_version][layer]
        slotsize = SLOTS[layer]
    except (IndexError, KeyError, TypeError):
        raise MPEGAudioHeaderException('Frame size cannot be determined.')

    bitrate_k = bitrate * 1000

    framesize = int((coeff * bitrate_k / sample_rate) + padding_size) * slotsize
    if framesize <= 0:
        raise MPEGAudioHeaderException('Frame size cannot be calculated.')
    return framesize
        


src/m/p/mpeg1audio-0.5.2/src/mpeg1audio/__init__.py   mpeg1audio(Download)
        self.samples_per_frame = headers.get_samples_per_frame(self.version,
                                                               self.layer)
        self.size = headers.get_frame_size(self.version, self.layer,
                                           self.sample_rate, self.bitrate,
                                           self._padding_size)

src/m/p/mpeg1audio-HEAD/src/mpeg1audio/__init__.py   mpeg1audio(Download)
        self.samples_per_frame = headers.get_samples_per_frame(self.version,
                                                               self.layer)
        self.size = headers.get_frame_size(self.version, self.layer,
                                           self.sample_rate, self.bitrate,
                                           self._padding_size)