Browse Source

creates sequence size variable for readability

pull/65/head
Hongyu Li 2 years ago
parent
commit
45f42fb5a5
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      vz_acoustic_scene_analysis/scripts/stretch_audio.py

+ 3
- 4
vz_acoustic_scene_analysis/scripts/stretch_audio.py View File

@ -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)

Loading…
Cancel
Save