audio: auxiliary pauses should be harmless now, place them back just in case

This commit is contained in:
Dmitry Fedorov 2020-06-24 15:22:34 +03:00
parent a68144e688
commit a27a8edf88
No known key found for this signature in database
GPG Key ID: C61C7F61C4D85F8D

View File

@ -551,11 +551,14 @@ class TC_00_AppVMMixin(object):
'parecord --raw --format=float32le --rate=44100 \
--channels=1 audio_rec.raw'))
# give it time to start recording
self.loop.run_until_complete(asyncio.sleep(0.5))
p = subprocess.Popen(['sudo', '-E', '-u', local_user,
'paplay', '--raw', '--format=float32le',
'--rate=44100', '--channels=1'],
stdin=subprocess.PIPE)
p.communicate(audio_in.astype(np.float32).tobytes())
# wait for possible parecord buffering
self.loop.run_until_complete(asyncio.sleep(1))
self.loop.run_until_complete(
self.testvm1.run_for_stdio('pkill parecord || :'))
_, record_stderr = self.loop.run_until_complete(record.communicate())