tempo-riz / deepgram_speech_to_text

A Deepgram client for Dart and Flutter, supporting all Speech-to-Text and Text-to-Speech features on every platform.
https://pub.dev/packages/deepgram_speech_to_text
MIT License
3 stars 8 forks source link

WebSocketException: Connection to ... not upgraded to websocket #5

Closed bbence84 closed 6 months ago

bbence84 commented 6 months ago

Not sure what I am missing, but I'm getting the following error both on the Android emulator and on a physical device connected to Android studio and the flutter project ran in debug mode:

E/flutter ( 8503): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: WebSocketException: Connection to 'https://api.deepgram.com:0/v1/listen?model=whisper-medium&language=hu&filler_words=false&punctuation=true#' was not upgraded to websocket
E/flutter ( 8503): #0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
E/flutter ( 8503): #1      WebSocket.connect (dart:_http/websocket.dart:320:22)
E/flutter ( 8503): #2      new IOWebSocketChannel.connect (package:web_socket_channel/io.dart:81:28)
E/flutter ( 8503): #3      connect (package:web_socket_channel/src/_connect_io.dart:15:24)
E/flutter ( 8503): #4      new WebSocketChannel.connect (package:web_socket_channel/src/channel.dart:144:16)
E/flutter ( 8503): #5      DeepgramLiveTranscriber.start (package:deepgram_speech_to_text/src/deepgram.dart:27:34)
E/flutter ( 8503): #6      Deepgram.transcribeFromLiveAudioStream (package:deepgram_speech_to_text/src/deepgram.dart:147:17)
E/flutter ( 8503): #7      _AssistantPageState.sendTextToAi (package:assistant_bootstrap/pages/assistant.dart:318:42)
E/flutter ( 8503): <asynchronous suspension>
E/flutter ( 8503): 

Maybe it's something obvious, sorry!

Thanks!

tempo-riz commented 6 months ago

Hello can you provide a sample of the code that produces the error ?

From the error it seems you are using live transcription with whisper model, I don't think whisper supports live transcription from the doc : https://developers.deepgram.com/reference/listen-live

Maybe you can try another model to see if the issue persist ?

tempo-riz commented 6 months ago

Feel free to reopen if you think the issue is coming from the package :)