srcnalt / OpenAI-Unity

An unofficial OpenAI Unity Package that aims to help you use OpenAI API directly in Unity Game engine.
MIT License
694 stars 153 forks source link

When microphone is off I get the word "you" in the "Text" field in the API response with Whisper #65

Closed MahmoudAbusaqer closed 1 year ago

MahmoudAbusaqer commented 1 year ago

Describe the bug Most often when the microphone is muted or there is no sound around I get the word "you" in the "Text" field from the API response to the Whisper API which is wired there should be nothing just an empty string.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Whisper Sample scene and add this line to the Whisper code in the EndRecording method: Debug.Log("response: " + res.Serialize());.
  2. Click on Play and mute your microphone.
  3. Scroll down on the console and see the result of the line we add in step 1.
  4. See the error.

Expected behavior When there is no sound around or the microphone is muted the "Text" field from the response of the Whisper API should have a value of an empty string "" not the word "you".

Screenshots image

Environment

srcnalt commented 1 year ago

Hi @MahmoudAbusaqer same happens to me too, and this is a OpenAI/Whisper related issue. Apparently it returns "you" for silence or white noise. There is nothing I can propose other than processing the audio in your solution and ignore such audio as input.

image