Fix arguments order in pcm_to_np call

pcm_to_np takes segment buffer as its first argument and audio format as a second one. The wrong order cause "bytes object has no attribute 'channels'' ArgumentError.
This commit is contained in:
Marek Grzegorek 2020-06-03 18:05:52 +02:00 committed by GitHub
parent 64fd79f9c1
commit 8a87d1d100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ def split_audio_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)
samples = pcm_to_np(segment_buffer, audio_format)
yield time_start, time_end, samples
def to_mfccs(time_start, time_end, samples):