You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dnhrdt I dont see this error "Unexpected error: a bytes-like object is required, not 'str'" on my end if I disconnect the client with a KeyboardInterrupt. Can you please be more specific on how to reproduce this?
What I see on the server side if do a KeyboardInterrupt on the client side:
INFO:faster_whisper:Processing audio with duration 00:02.816
INFO:faster_whisper:VAD filter removed 00:00.000 of audio
INFO:root:Connection closed by client
INFO:root:Cleaning up.
ERROR:root:[ERROR]: Sending data to client: received 1000 (OK); then sent 1000 (OK)
INFO:root:Exiting speech to text thread
There is a type mismatch between the server's expected data type and the client's sent data type when handling the end-of-audio signal.
Issue
The server's get_audio_from_websocket() method expects binary data and checks for b"END_OF_AUDIO":
However, the ServeClientBase.disconnect() method sends a string message:
This causes a "bytes-like object is required, not 'str'" error when the server tries to process the disconnect message.
Steps to Reproduce
Expected Behavior
The server should either:
Suggested Fix
Either:
Modify disconnect() to send binary data:
Or modify get_audio_from_websocket() to handle both binary and string data:
The text was updated successfully, but these errors were encountered: