(self)
| 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: |
no test coverage detected