[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") warnings.filterwarnings("ignore")
seg = Segmenter() seg = Segmenter()
audio_file = '../test.mp3'
# Warmup run # Warmup run
results = process(seg, ['../test.flac']) results = process(seg, [audio_file])
print(results) print(results)
# # Actual run # # Actual run
@@ -189,11 +190,10 @@ def test():
# Benchmark # Benchmark
iterations = 60 iterations = 60
total_time = 0 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"')) 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): for i in range(iterations):
results = process(seg, ['../test.flac']) results = process(seg, [audio_file])
total_time += results.time_full 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') print(f'Benchmark result: {total_time}s / {iterations} iterations = {total_time / iterations / audio_len} seconds of processing per second in audio')