Hello gang,
I’ve an issue concerning the part of receiving response using LIVE API, could any explain me why it happens and how prevent it ?
Here’s a snippet of my code :
turn = session.receive()
print("Getting response")
print(turn)
start = time.perf_counter()
async for response in turn:
if response.data is not None:
wav_chunk = create_wav_chunk(response.data)
yield wav_chunk
import asyncio
… other setup code …
async def process_stream():
try:
turn = session.receive()
print(“Waiting for response from LIVE API…”)
async for response in turn:
if response.data is not None:
wav_chunk = create_wav_chunk(response.data)
yield wav_chunk
print(“End of response stream.”)
except StopAsyncIteration:
print(“Stream finished successfully.”)
except Exception as e:
print(f"An error occurred during streaming: {e}")
finally:
Perform any necessary cleanup, like closing the session
await session.close()
Fungsi kan dengan hati hati. I’m from Indonesia.
You now???
Hi @Reda_Elmarrakchy,
We reproduced your code and its working correctly on our end. Please confirm if you are still facing this issue?