MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / read_audio

Method read_audio

LangHelper/recoder.py:38–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36 self.save_to_wav(file_path, self.chunks)
37
38 def read_audio(self):
39 if not self.stream:
40 raise Exception("Stream not open. Call start() first.")
41 while True:
42 data = self.stream.read(1280)
43 yield data
44
45 def save_to_pcm(self, filename, frames):
46 with open(filename, "wb") as f:

Callers 1

RealTimeSttFunction · 0.80

Calls 1

readMethod · 0.80

Tested by

no test coverage detected