Recorder can log without recording voice

This commit is contained in:
Hugvey Central Command 2019-06-16 16:16:15 +02:00
parent 16fbee7555
commit c3cae1ea25

View file

@ -50,12 +50,10 @@ class Recorder:
def writeData(self):
if self.record_voice:
if len(self.data) < 1:
self.logger.info("Skip empty wave creation")
return
if self.record_voice:
else:
self.fragmentNr += 1
fn = os.path.join(self.out_folder, f"{self.fragmentNr}.wav")
@ -79,9 +77,6 @@ class Recorder:
self.currentTranscription = ""
def receive(self, chunk):
if not self.record_voice:
return
if not self.running:
return
@ -100,6 +95,12 @@ class Recorder:
else:
self.subsequentMutedFrames = 0
if not self.record_voice:
# we only check this here, as the writeData above is used to write
# transcriptions to the log.
return
d = array('h', chunk)
self.data.extend(d)
# self.wf.writeframes(chunk)