MCPcopy Create free account
hub / github.com/SevaSk/ecoute / __init__

Method __init__

custom_speech_recognition/__init__.py:317–320  ·  view source on GitHub ↗
(self, audio_reader, little_endian, samples_24_bit_pretending_to_be_32_bit)

Source from the content-addressed store, hash-verified

315
316 class AudioFileStream(object):
317 def __init__(self, audio_reader, little_endian, samples_24_bit_pretending_to_be_32_bit):
318 self.audio_reader = audio_reader # an audio file object (e.g., a `wave.Wave_read` instance)
319 self.little_endian = little_endian # whether the audio data is little-endian (when working with big-endian things, we'll have to convert it to little-endian before we process it)
320 self.samples_24_bit_pretending_to_be_32_bit = samples_24_bit_pretending_to_be_32_bit # this is true if the audio is 24-bit audio, but 24-bit audio isn't supported, so we have to pretend that this is 32-bit audio and convert it on the fly
321
322 def read(self, size=-1):
323 buffer = self.audio_reader.readframes(self.audio_reader.getnframes() if size == -1 else size)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected