hume-python-sdk
hume-python-sdk copied to clipboard
I want to get each response in real time, so that I will post-process and print on the screen. How should I do that
import asyncio
from hume import HumeVoiceClient, MicrophoneInterface
async def main() -> None:
# Paste your Hume API key here
HUME_API_KEY = "key"
# Connect and authenticate with Hume
client = HumeVoiceClient(HUME_API_KEY)
# Start streaming EVI over your device's microphone and speakers
async with client.connect(config_id="id") as socket:
results = await MicrophoneInterface.start(socket)
while True:
message = await socket.receive()
print("message", message)
asyncio.run(main())