def __init__(self, aiff_file, sample_rate, channels, channel_mask, bits_per_sample, chunk_length, process=None): """aiff_file should be rewound to the start of the SSND chunk.""" alignment = AiffAudio.SSND_ALIGN.parse_stream(aiff_file) PCMReader.__init__(self, file=__capped_stream_reader__( aiff_file, chunk_length - AiffAudio.SSND_ALIGN.sizeof()), sample_rate=sample_rate, channels=channels, channel_mask=channel_mask, bits_per_sample=bits_per_sample, process=process, signed=True, big_endian=True) self.ssnd_chunk_length = chunk_length - 8 standard_channel_mask = ChannelMask(self.channel_mask) aiff_channel_mask = AIFFChannelMask(standard_channel_mask) if (channels in (3, 4, 6)): self.channel_order = [aiff_channel_mask.channels().index(channel) for channel in standard_channel_mask.channels()] else: self.channel_order = None
def __init__(self, aiff_file, sample_rate, channels, channel_mask, bits_per_sample, chunk_length, process=None): """aiff_file should be rewound to the start of the SSND chunk.""" alignment = AiffAudio.SSND_ALIGN.parse_stream(aiff_file) PCMReader.__init__(self, file=__capped_stream_reader__( aiff_file, chunk_length - AiffAudio.SSND_ALIGN.sizeof()), sample_rate=sample_rate, channels=channels, channel_mask=channel_mask, bits_per_sample=bits_per_sample, process=process, signed=True, big_endian=True) self.ssnd_chunk_length = chunk_length - 8 standard_channel_mask = ChannelMask(self.channel_mask) aiff_channel_mask = AIFFChannelMask(standard_channel_mask) if (channels in (3, 4, 6)): self.channel_order = [ aiff_channel_mask.channels().index(channel) for channel in standard_channel_mask.channels() ] else: self.channel_order = None
def __init__(self, reader, tempdir, symlink): PCMReader.__init__(self, None, sample_rate=reader.sample_rate, channels=reader.channels, channel_mask=reader.channel_mask, bits_per_sample=reader.bits_per_sample) self.tempdir = tempdir self.symlink = symlink self.reader = reader self.closed = False
def __init__(self, au_file, data_size, sample_rate, channels, channel_mask, bits_per_sample): """au_file is a file, data_size is an integer byte count. sample_rate, channels, channel_mask and bits_per_sample are ints. """ PCMReader.__init__(self, file=au_file, sample_rate=sample_rate, channels=channels, channel_mask=channel_mask, bits_per_sample=bits_per_sample) self.data_size = data_size
def __init__(self, au_file, data_size, sample_rate, channels, channel_mask, bits_per_sample): """au_file is a file, data_size is an integer byte count. sample_rate, channels, channel_mask and bits_per_sample are ints. """ PCMReader.__init__(self, file=au_file, sample_rate=sample_rate, channels=channels, channel_mask=channel_mask, bits_per_sample=bits_per_sample) self.data_size = data_size