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

Method stop

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

Source from the content-addressed store, hash-verified

25 self.chunks = []
26
27 def stop(self):
28 print("stop recording!")
29 if self.stream:
30 self.stream.stop_stream()
31 self.stream.close()
32 self.stream = None
33 file_path = os.path.join(self.root_path,"realtime.pcm")
34 self.save_to_pcm(file_path,self.chunks)
35 file_path = os.path.join(self.root_path,"realtime.wav")
36 self.save_to_wav(file_path, self.chunks)
37
38 def read_audio(self):
39 if not self.stream:

Callers 2

SpeechRecognitionFunction · 0.80
RealTimeSttFunction · 0.80

Calls 3

save_to_pcmMethod · 0.95
save_to_wavMethod · 0.95
closeMethod · 0.80

Tested by

no test coverage detected