def generate_values(): frames = read_frames_from_file(audio_path) segments = vad_split(frames, aggressiveness=aggressiveness) for segment in segments: segment_buffer, time_start, time_end = segment samples = pcm_to_np(audio_format, segment_buffer) yield time_start, time_end, samples
def generate_values(): frames = read_frames_from_file(audio_path) segments = vad_split(frames, aggressiveness=aggressiveness) for segment in segments: segment_buffer, time_start, time_end = segment samples = np.frombuffer(segment_buffer, dtype=np.int16) samples = samples * multiplier samples = np.expand_dims(samples, axis=1) yield time_start, time_end, samples