Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,976 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm trying to use REST API for Speech To Text as below.
const endpoint = `https://${azureRegion}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1`;
const query = new URLSearchParams({ language: 'en-US' });
const url = `${endpoint}?${query}`;
const headers = {
'Ocp-Apim-Subscription-Key': azureSubscriptionKey,
'Content-Type': 'audio/wav; codecs=audio/pcm; samplerate=16000',
'Accept': 'application/json'
};
const response = await fetch(url, {
method: 'POST',
body,
headers,
});
And I used a wav file tested by many people as a reference, saying "What's the weather like".
API response looks not correct because DisplayText ontains only a partial word of the audio. ("The.")
Recognition result: {
RecognitionStatus: 'Success',
Offset: 8900000,
Duration: 44500000,
DisplayText: 'The.'
}
FYI the code above gets the arraybuffer of the wav file for 'body'. Please let me know how to fix it it...