diff --git a/rtcllm/stt.py b/rtcllm/stt.py index fd232fb..92aabb2 100644 --- a/rtcllm/stt.py +++ b/rtcllm/stt.py @@ -1,3 +1,4 @@ +import aiohttp from appPublic.dictObject import DictObject from appPublic.oauth_client import OAuthClient @@ -35,8 +36,14 @@ opts = { async def asr(a_file): oc = OAuthClient(DictObject(**opts)) with open(a_file, 'rb') as f: - r = await oc("http://open-computing.cn", "asr", {"audio_file":f}) - print(f'{r=}') + async with aiohttp.ClientSession() as session: + async with session.post("http://open-computing.cn/asr/generate", data={ + "model":"whisper", + "audio_file":f + }) as response: + r = await response.json() + print(f'{r=}') + return r """ segments, info = model.transcribe(a_file, beam_size=5) txt = ''