Recorder can log without recording voice
This commit is contained in:
parent
16fbee7555
commit
c3cae1ea25
1 changed files with 19 additions and 18 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue