diff --git a/rtcllm/stt.py b/rtcllm/stt.py index d885076..711a2db 100644 --- a/rtcllm/stt.py +++ b/rtcllm/stt.py @@ -36,10 +36,13 @@ opts = { async def asr(a_file): if not a_file: return - oc = OAuthClient(DictObject(**opts)) - r = await oc('http://open-computing.cn', 'asr', {'audio_file':f}) - print(f'{r=}') + r = None + with open(a_file, 'rb') as f: + oc = OAuthClient(DictObject(**opts)) + r = await oc('http://open-computing.cn', 'asr', {'audio_file':f}) + print(f'{r=}') return r + with open(a_file, 'rb') as f: async with aiohttp.ClientSession() as session: async with session.post("http://open-computing.cn/asr/generate", data={