wit icon indicating copy to clipboard operation
wit copied to clipboard

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

Open CazCzw opened this issue 2 years ago • 5 comments

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.

CazCzw avatar Apr 08 '23 16:04 CazCzw

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.

maidaneze avatar Apr 18 '23 12:04 maidaneze

AppID: 607996611350377 I don't have any audio clips saved, but it was 40s regardless of how long the clip was. They were all just me saying "Testing 1,2,3" and all worked immediately when I switched to the Speech API instead.

Mr. Caz Czworkowski Data Enablement Lead GSK Tel: 609.827.1064

On Tue, Apr 18, 2023 at 8:04 AM maidaneze @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/wit-ai/wit/issues/2610#issuecomment-1512968179, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4N4SIDJSWJ3QYDI73VEBH3XBZ7NJANCNFSM6AAAAAAWXRFSKY . You are receiving this because you authored the thread.Message ID: @.***>

CazCzw avatar Apr 18 '23 12:04 CazCzw

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?

maidaneze avatar Apr 24 '23 10:04 maidaneze

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 avatar May 07 '23 10:05 n0th1ng-else

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

elemosel avatar May 28 '23 22:05 elemosel