You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a push stream as input assumes that the audio data is a raw PCM and skips any headers. The API still works in certain cases if the header hasn't been skipped. For the best results, consider implementing logic to read off the headers so that `byte[]` begins at the *start of the audio data*.
152
+
Using a push stream as input assumes that the audio data is a raw PCM and skips any headers. The API still works in certain cases if the header hasn't been skipped. For the best results, consider implementing logic to read off the headers so that `byte[]` begins at the *start of the audio data*. To address this issue, you can utilize [GStreamer](./how-to-use-codec-compressed-audio-input-streams.md). GStreamer provides a flexible pipeline-based framework that allows you to implement logic to read off the headers, ensuring that the byte array begins at the start of the audio data.
153
153
154
154
## Handle errors
155
155
156
-
The previous examples only get the recognized text from the `result.Text` property. To handle errors and other responses, you need to write some code to handle the result. The following code evaluates the [`result.Reason`](/dotnet/api/microsoft.cognitiveservices.speech.recognitionresult.reason) property and:
156
+
The previous examples only get the recognized text from the `speechRecognitionResult.Text` property. To handle errors and other responses, you need to write some code to handle the result. The following code evaluates the [`speechRecognitionResult.Reason`](/dotnet/api/microsoft.cognitiveservices.speech.recognitionresult.reason) property and:
157
157
158
158
* Prints the recognition result: `ResultReason.RecognizedSpeech`.
159
159
* If there's no recognition match, it informs the user: `ResultReason.NoMatch`.
160
160
* If an error is encountered, it prints the error message: `ResultReason.Canceled`.
The previous examples only get the recognized text by using `result.getText()`. To handle errors and other responses, you need to write some code to handle the result. The following example evaluates [`result.getReason()`](/java/api/com.microsoft.cognitiveservices.speech.recognitionresult.getreason) and:
102
+
The previous examples only get the recognized text by using `speechRecognitionResult.getText()`. To handle errors and other responses, you need to write some code to handle the result. The following example evaluates [`speechRecognitionResult.getReason()`](/java/api/com.microsoft.cognitiveservices.speech.recognitionresult.getreason) and:
103
103
104
104
* Prints the recognition result: `ResultReason.RecognizedSpeech`.
105
105
* If there's no recognition match, it informs the user: `ResultReason.NoMatch`.
106
106
* If an error is encountered, it prints the error message: `ResultReason.Canceled`.
0 commit comments