microsoft / cognitive-services-speech-sdk-js

Microsoft Azure Cognitive Services Speech SDK for JavaScript
Other
263 stars 97 forks source link

[Bug]: Azure Speech Recognition Not Converting Speech to Text for Chinese Language #824

Closed rohit1coding closed 3 months ago

rohit1coding commented 4 months ago

What happened?

Description: We are experiencing an issue with Azure Speech Recognition where it is unable to convert speech to text for the Chinese language. The service works correctly for other languages across all environments. Additionally, the Chinese language conversion works fine in local and staging environments but fails in the preprod and prod environments.

Details

Expected Behavior Chinese speech should be accurately converted to text in preprod and prod environments, just as it does in local and staging environments.

Actual Behavior Chinese speech is not being converted to text in the preprod and prod environments, The recognizer is not giving any result at all. However, it works correctly in local and staging environments, and other languages are processed correctly across all environments.

Requested Action We need assistance in diagnosing and resolving the issue preventing Chinese language speech-to-text conversion in the preprod and prod environments.

Version

1.32.0

What browser/platform are you seeing the problem on?

No response

Relevant log output

No response

rohit1coding commented 4 months ago

I have seen that it's working in the EU region but it's not working in the US region.

glharper commented 4 months ago

I have seen that it's working in the EU region but it's not working in the US region.

Just tested STT in Chinese on Eastus2, and it's working. Which specific region in the US are you seeing this issue? Also, what differences exist between your prod and staging environments that could affect Chinese recognition/character display?

rohit1coding commented 4 months ago

The entire codebase and Azure credentials are the same for both staging and preprod however staging is working preprod is not.

glharper commented 4 months ago

@rohit1coding Could you capture logs and share them?

sdk.Diagnostics.SetLoggingLevel(sdk.LogLevel.Debug);
sdk.Diagnostics.SetLogOutputPath("LogfilePathAndName");
rohit1coding commented 4 months ago

here is the log: 2024-05-21T12:05:42.885Z | RecognitionTriggeredEvent | privName: RecognitionTriggeredEvent | privEventId: A79D88B3C2DE4BD994F74052BD2B63B4 | privEventTime: 2024-05-21T12:05:42.885Z | privEventType: 1 | privMetadata: {} | privRequestId: 9AEA6F7C42BC46329CA096700188B15E | privSessionId: <NULL> | privAudioSourceId: 1DE6A1ABBBC94DCCB7B3A5F310FB7F38 | privAudioNodeId: CADED12CE82C4C6EB9DA604178ECAF1C

glharper commented 4 months ago

@rohit1coding I'd expect the log to be a little longer, could you enable logging before instantiating the recognizer?

rohit1coding commented 4 months ago

The log was in an infinite loop:- 2024-05-21T12:06:18.814Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: 509FD10A096C4C0CAD0CE5D6EDD443CF | privEventTime: 2024-05-21T12:06:18.814Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:18.814Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:18.814Z"},"privId":"A0CF63F5D9DD42C7BFEC49F7CF2172E3","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null} 2024-05-21T12:06:18.942Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: FCD8709FE5864A52B81C48971C232829 | privEventTime: 2024-05-21T12:06:18.942Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:18.942Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:18.941Z"},"privId":"7E6756D90D8C47A0A39DB6E53C8B7F73","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null} 2024-05-21T12:06:19.070Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: BCDE3A263604488D9FA26B9AA104BB39 | privEventTime: 2024-05-21T12:06:19.070Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:19.070Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:19.070Z"},"privId":"9C5E1953EB4E4664A0FA696F5A644D0B","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null} 2024-05-21T12:06:19.129Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: 6B8489DC7E364600B2F143C25EAAA625 | privEventTime: 2024-05-21T12:06:19.129Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:19.129Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:19.128Z"},"privId":"23C63A19DA2845FB974BF2A7A4F081CF","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null} 2024-05-21T12:06:19.255Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: 1EA9B8E2D6B94C2680EA287D20EB582D | privEventTime: 2024-05-21T12:06:19.255Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:19.255Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:19.255Z"},"privId":"9D5F3F11E46446FBA76DA6334AB387CB","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null} 2024-05-21T12:06:19.325Z | ConnectionMessageSentEvent | privName: ConnectionMessageSentEvent | privEventId: C230E705B45D45AC87773EE1B12244F3 | privEventTime: 2024-05-21T12:06:19.325Z | privEventType: 1 | privMetadata: {} | privConnectionId: C75E2B52836342C79D9F379E83FD3362 | privNetworkSentTime: 2024-05-21T12:06:19.325Z | privMessage: {"privBody":{},"privMessageType":1,"privHeaders":{"Path":"audio","X-RequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","X-Timestamp":"2024-05-21T12:06:19.325Z"},"privId":"88943191EDC84DD9BE86D09743E8C48E","privSize":3200,"privPath":"audio","privRequestId":"44E81D67EBFF4C18BC639FE5D8D3EC5C","privContentType":null}

glharper commented 4 months ago

@rohit1coding The log you've added starts at 2024-05-21T12:06:18.814Z and ends at 2024-05-21T12:06:19.325Z, so it lasts 1.5s. This is not long enough for me to have any idea what's happening. Please attach a longer log that happens during the time that a recognition result is received, but no text is displayed (you should see "ConnectionMessageReceivedEvent" in the log). Also, please attach the log as file, as it may be too large to understand as a comment.

rohit1coding commented 3 months ago

Hi @glharper, we are still facing this issue where speech-to-text is working for all the languages except Chinese in our preprod and production server, it's weird that locally everything is working fine but after deploying only Chinese is not working.

do you know what can be the issue? we are using the same credentials of Azure locally and on deployment but still deployment one is not working.

rohit1coding commented 3 months ago

This issue is fixed now, without any changes. All of a sudden it started working in all of our envirement.