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 sample rate by MPEG version and given MPEG Header sample rate bits.

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

:param bits: Sample rate bits in MPEG header.
:type bits: int

:return: Sample rate in Hz(more...)

        def get_sample_rate(mpeg_version, bits):
    """Get sample rate by MPEG version and given MPEG Header sample rate bits.
    
    :param mpeg_version: Version of the MPEG, as returned by 
        :func:`get_mpeg_version`
    :type mpeg_version: string
    
    :param bits: Sample rate bits in MPEG header.
    :type bits: int
    
    :return: Sample rate in Hz
    :rtype: int
    
    :raise mpeg1audio.MPEGAudioHeaderException: Raised when sample rate cannot
        be determined.
    
    """

    try:
        return SAMPLERATE[mpeg_version][bits]
    except (KeyError, TypeError, IndexError):
        raise MPEGAudioHeaderException('Sample rate cannot be determined.')
        


src/m/p/mpeg1audio-0.5.2/src/mpeg1audio/__init__.py   mpeg1audio(Download)
        self.bitrate = headers.get_bitrate(self.version, self.layer,
                                           bitrate_bits)
        self.sample_rate = headers.get_sample_rate(self.version,
                                                   samplerate_bits)
        self.channel_mode = headers.get_channel_mode(mode_bits)

src/m/p/mpeg1audio-HEAD/src/mpeg1audio/__init__.py   mpeg1audio(Download)
        self.bitrate = headers.get_bitrate(self.version, self.layer,
                                           bitrate_bits)
        self.sample_rate = headers.get_sample_rate(self.version,
                                                   samplerate_bits)
        self.channel_mode = headers.get_channel_mode(mode_bits)