"""Real WebSocket / ASR / diarization / TTS check with synthetic fixtures only.""" import argparse,asyncio,json,struct,subprocess,time from pathlib import Path import aiohttp import numpy as np from speaker_v4.common import atomic from .fixtures import ROOT def audio(name): p=subprocess.run(['ffmpeg','-nostdin','-v','error','-i',str(ROOT/(name+'.mp3')),'-ar','16000','-ac','1','-f','f32le','pipe:1'],capture_output=True,check=True) x=np.frombuffer(p.stdout,'0,'No spoken reply while background continued' assert any(e.get('speaker_name')=='Christoph' for e in events if e.get('type')=='endpoint'),'Speaker name not bound after full introduction' finally: await ws.close();task.cancel();await asyncio.gather(task,return_exceptions=True) if __name__=='__main__': parser=argparse.ArgumentParser();parser.add_argument('--url',default='http://127.0.0.1:8793');parser.add_argument('--mode',default='v4-long');a=parser.parse_args() asyncio.run(main(a.url,a.mode))