speechmatics / speechmatics-js-sdk

Javascript and Typescript SDK for Speechmatics
MIT License
40 stars 7 forks source link

Events not being sent, only until after the connection was closed #53

Open willemmulder opened 5 months ago

willemmulder commented 5 months ago

Describe the bug I have two scenarios where the Speechmatics SDK is not returning an Event that I expect. Only after I close the connection, the event is returned. Not sure if it's the API or the SDK that is the culprit.

Two examples:

Speechmatics session error { message: 'Error', type: 'invalid_audio_type', reason: 'Invalid audio type: Could not determine type of stream.' }

To Reproduce

Expected behavior I expect for the two scenarios

  1. Short files should be fully transcribed, It feels as if Speechmatics keeps on waiting for more audio. However, setting max_delay does not help either.
  2. Invalid files should immediately be rejected with an Error.

Desktop (please complete the following information):

nickgerig commented 5 months ago

@willemmulder thanks for this - I was able to reproduce both issues, we'll take a look.

willemmulder commented 5 months ago

@nickgerig Sure; and thanks for checking! Looking forward to more news :-)

willemmulder commented 3 months ago

Hey @nickgerig is there any update on this? It's quite annoying in our situation... Thanks! :-)

nickgerig commented 3 months ago

@willemmulder I chatted with one of the engineers yesterday:

For the error case our API is waiting for something it can decipher rather than exiting immediately. So the onus is on the client to make sure that they are sending audio.

For the short file example could you give me a test case? I'm struggling to reproduce it in using the SDK example.

willemmulder commented 3 months ago

Hey @nickgerig thanks for checking!

For the error case I do understand that we can/should also be checking our data, but I also expect Speechmatics to return an error when it receives and EOF and no audio has been sent. But let me check whether we actually send EndOfStream.

For the other case, let me see if I can get an example audio file to test with.