hume-python-sdk icon indicating copy to clipboard operation
hume-python-sdk copied to clipboard

sending files over using evi

Open lithafnium opened this issue 9 months ago • 1 comments

Hey there! Trying to use the EVI API right now to interface with the voice assistant. Is it possible to interact with the assistant by sending over audio files instead of the microphone? I saw an example in test_service_hume_voice_client_chat.py, but copying it over seems to hang when awaiting for messages in the socket.

The code I'm trying out is this:

async def main():
    client = HumeVoiceClient(HUME_API_KEY)
    async with client.connect() as socket:
        await socket.update_session_settings(sample_rate=16_000, num_channels=1)

        await socket.send_file(Path("./speech.wav"))

        async for message_str in socket:
            message = json.loads(message_str)
            print(message)

asyncio.run(main())

lithafnium avatar May 27 '24 04:05 lithafnium