Commit 4206e7ed authored by Stefan Westerfeld's avatar Stefan Westerfeld

Pass commandline to ttfb-test.py; display average time.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 7c077a88
......@@ -3,13 +3,21 @@
# test how long the watermarker takes until the first audio sample is available
import subprocess
import shlex
import time
import sys
seconds = 0
for i in range (10):
start_time = time.time()
proc = subprocess.Popen (["audiowmark", "add", "test/T01__09_sing_sang_sung.flac.wav", "-", "f0"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
start_time = time.time() * 1000
proc = subprocess.Popen (shlex.split (sys.argv[1]), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# we wait for actual audio data, so we read somewhat larger amount of data that the wave header
x = proc.stdout.read (1000)
end_time = time.time()
print (end_time - start_time, x[0:4], len (x))
end_time = time.time() * 1000
seconds += end_time - start_time
print ("%.2f" % (end_time - start_time), x[0:4], len (x))
print ("%.2f" % (seconds / 10), "avg")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment