From 45f42fb5a5bf316d6311b3de6e6ab18af1fa81c2 Mon Sep 17 00:00:00 2001
From: Hongyu Li
Date: Tue, 29 Mar 2022 15:14:16 -0400
Subject: [PATCH] creates sequence size variable for readability
---
vz_acoustic_scene_analysis/scripts/stretch_audio.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/vz_acoustic_scene_analysis/scripts/stretch_audio.py b/vz_acoustic_scene_analysis/scripts/stretch_audio.py
index 001bb8d..6987892 100755
--- a/vz_acoustic_scene_analysis/scripts/stretch_audio.py
+++ b/vz_acoustic_scene_analysis/scripts/stretch_audio.py
@@ -218,10 +218,9 @@ class ROSInterface:
def get_audio(self):
recorded_frames = self.record_audio(self.chunk_size) # set param here chunk size
self.wav_list.append(recorded_frames)
- self.record_count += 1
- # Every 5 seconds for
- # if ((self.record_count % (self.secs/self.chunk_size)) == 0): # set param sequence size
- if (self.record_count % 3 == 0):
+ self.record_count += 1
+ self.sequence_size = 3 # self.secs/self.chunk_size
+ if (self.record_count % self.sequence_size == 0):
return_list = self.wav_list
# Remove fist two objects in array to remove 0.2 seconds of audio data from array
self.wav_list.pop(0)