Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictation API Taking 40 seconds to respond. Speech is API is fast. #2610

Open
CazCzw opened this issue Apr 8, 2023 · 5 comments
Open

Dictation API Taking 40 seconds to respond. Speech is API is fast. #2610

CazCzw opened this issue Apr 8, 2023 · 5 comments

Comments

@CazCzw
Copy link

CazCzw commented Apr 8, 2023

Bug

Dictation API Taking 40 seconds to respond with small audio requests. Way too long.
Speech API takes <1 second without any other changes.

I am not using the Unity plugin since I just want pure transcription. I am just doing web requests.

I construct a POST for the dictations api like this:
`// Convert the AudioClip data to a byte array
byte[] data = AudioClipToWav(recording);

    System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
    
    UnityWebRequest www = new UnityWebRequest(witAiUrl, UnityWebRequest.kHttpVerbPOST);
    www.uploadHandler = new UploadHandlerRaw(data);
    www.downloadHandler = new DownloadHandlerBuffer();
    www.SetRequestHeader("Authorization", "Bearer " + witAiToken);
    www.SetRequestHeader("Content-Type", "audio/wav");
    Debug.Log("Sending request to Wit.ai");
    yield return www.SendWebRequest();`

If my endpoint is set to this
private const string witAiUrl = "https://api.wit.ai/speech?v=20230215";
it takes <1 second to return the right response.

If I set it to this:
private const string witAiUrl = "https://api.wit.ai/dictation?v=20230215"
it takes 40 seconds to return the correct response.

Same audio length. Just a quick 2 second "Hello world" audio clip that is being sent after 2 seconds.

@maidaneze
Copy link

Hi Caz, could you give us the wit appid?
It would also be useful if you could share the audio clip with us so we can debug the issue.

@CazCzw
Copy link
Author

CazCzw commented Apr 18, 2023 via email

@maidaneze
Copy link

I tried reproducing this issue but I couldn't. Is it still persisting? In case it is, could you attach an audio file that can consistently reproduce this issue?

@n0th1ng-else
Copy link

I am also experiencing this. I have a timeout 30sec for the request and I see in the logs it happens almost every day for a couple of requests. I do not have a file at hand, but I can put a time stamp for today's alert 2023-05-07T10:06:09.688Z probably this will help the investigation. the appId is 585410835512762

n0th1ng-else added a commit to n0th1ng-else/voice-to-text-bot that referenced this issue May 7, 2023
For some reason (wit-ai/wit#2610)
WitAi takes more than 30sec for dictation api. we do not
want users to wait so much time. does not make any sense.
I first decrease the timout to 10sec (which is still big)
Then I also fallback to speech api to give it a second
chance.
@elemosel
Copy link

Hey Same problem here,
im experiencing extreme high timout rates for 30 sec or higher until getting a response.

AppID: 6KFYX44B6QNIFHIJPK5TJ3OZJ6RYWVAW

as well as

AppID: MIKTFR2PJPA7OZELOR3KDNVY6RHE4KJU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants