openai icon indicating copy to clipboard operation
openai copied to clipboard

TimeoutException after 0:00:30.000000: Future not completed

Open ChunhThanhDe opened this issue 8 months ago • 0 comments
trafficstars

I use whisper-1 to convert voice to text with a 22mb mp3 file and get this error.

Does anyone have any solution for this case, if possible it would be good to see the processing progress as %

MyCode:


  Future<String> convertSpeechToText(String filePath) async {
    File audioFile = File(filePath);

    try {
      print(" convertSpeechToText start transcription ");
      OpenAIAudioModel transcription = await OpenAI.instance.audio.createTranscription(
        file: audioFile,
        model: "whisper-1",
        responseFormat: OpenAIAudioResponseFormat.text,
      );
      print(" convertSpeechToText start done ");
      return transcription.text;
    } catch (e) {
      print(" convertSpeechToText error " + e.toString());
      return "Error: $e";
    }
  }

my log

D/FilePickerUtils(10601): File loaded and cached at:/data/user/0/com.example.tutor_ai/cache/file_picker/1741079453984/Cách để tập trung làm việc.mp3
D/FilePickerDelegate(10601): File path:[com.mr.flutter.plugin.filepicker.FileInfo@ace0a0f]
I/flutter (10601):  convertSpeechToText start
I/flutter (10601):  convertSpeechToText start transcription 
I/flutter (10601):  convertSpeechToText error TimeoutException after 0:00:30.000000: Future not completed
Lost connection to device.

ChunhThanhDe avatar Mar 04 '25 09:03 ChunhThanhDe