[F] Fix audio_file

This commit is contained in:
Hykilpikonna
2022-02-10 16:31:34 -05:00
parent 30e9dd3cb9
commit 14d12a9d6b
+3 -3
View File
@@ -177,9 +177,10 @@ def test():
warnings.filterwarnings("ignore")
seg = Segmenter()
audio_file = '../test.mp3'
# Warmup run
results = process(seg, ['../test.flac'])
results = process(seg, [audio_file])
print(results)
# # Actual run
@@ -189,11 +190,10 @@ def test():
# Benchmark
iterations = 60
total_time = 0
audio_file = '../test.flac'
audio_len = float(subprocess.getoutput(f'ffprobe -i {audio_file} -show_entries format=duration -v quiet -of csv="p=0"'))
for i in range(iterations):
results = process(seg, ['../test.flac'])
results = process(seg, [audio_file])
total_time += results.time_full
print(f'Benchmark result: {total_time}s / {iterations} iterations = {total_time / iterations / audio_len} seconds of processing per second in audio')