Skip to content

Commit 7c14c64

Browse files
author
Jill Grant
authored
Merge pull request #237033 from eric-urban/eur/rest-qs
rest qs
2 parents c9717be + 0db8a45 commit 7c14c64

File tree

3 files changed

+29
-36
lines changed

3 files changed

+29
-36
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/speech-to-text-basics/rest.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.author: eur
1414

1515
[!INCLUDE [Prerequisites](../../common/azure-prerequisites.md)]
1616

17-
You will also need a `.wav` audio file on your local machine. You can use your own `.wav` file (up to 30 seconds) or download the [https://crbn.us/whatstheweatherlike.wav](https://crbn.us/whatstheweatherlike.wav) sample file.
17+
You will also need a `.wav` audio file on your local machine. You can use your own `.wav` file (up to 60 seconds) or download the [https://crbn.us/whatstheweatherlike.wav](https://crbn.us/whatstheweatherlike.wav) sample file.
1818

1919
### Set environment variables
2020

@@ -29,13 +29,10 @@ At a command prompt, run the following cURL command. Replace `YourAudioFile.wav`
2929
# [Windows](#tab/windows)
3030

3131
```terminal
32-
audio_file=@'YourAudioFile.wav'
33-
34-
curl --location --request POST \
35-
"https://${SPEECH_REGION}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US" \
36-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
37-
--header "Content-Type: audio/wav" \
38-
--data-binary $audio_file
32+
curl --location --request POST "https://%SPEECH_REGION%.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US&format=detailed" ^
33+
--header "Ocp-Apim-Subscription-Key: %SPEECH_KEY%" ^
34+
--header "Content-Type: audio/wav" ^
35+
--data-binary "@YourAudioFile.wav"
3936
```
4037

4138
# [Linux](#tab/linux)
@@ -44,9 +41,9 @@ curl --location --request POST \
4441
audio_file=@'YourAudioFile.wav'
4542
4643
curl --location --request POST \
47-
"https://${SPEECH_REGION}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US" ^
48-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" ^
49-
--header "Content-Type: audio/wav" ^
44+
"https://${SPEECH_REGION}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US&format=detailed" \
45+
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
46+
--header "Content-Type: audio/wav" \
5047
--data-binary $audio_file
5148
```
5249

@@ -56,9 +53,9 @@ curl --location --request POST \
5653
audio_file=@'YourAudioFile.wav'
5754
5855
curl --location --request POST \
59-
"https://${SPEECH_REGION}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US" ^
60-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" ^
61-
--header "Content-Type: audio/wav" ^
56+
"https://${SPEECH_REGION}.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=en-US&format=detailed" \
57+
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
58+
--header "Content-Type: audio/wav" \
6259
--data-binary $audio_file
6360
```
6461

@@ -67,7 +64,7 @@ curl --location --request POST \
6764
> [!IMPORTANT]
6865
> Make sure that you set the `SPEECH__KEY` and `SPEECH__REGION` environment variables as described [above](#set-environment-variables). If you don't set these variables, the sample will fail with an error message.
6966
70-
You should receive a response similar to what is shown here. The `DisplayText` should be the text that was recognized from your audio file. Up to 30 seconds of audio will be recognized and converted to text.
67+
You should receive a response similar to what is shown here. The `DisplayText` should be the text that was recognized from your audio file. Up to 60 seconds of audio will be recognized and converted to text.
7168

7269
```console
7370
{

articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics/rest.md

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,22 @@ At a command prompt, run the following cURL command. Optionally you can rename `
2727
# [Windows](#tab/windows)
2828

2929
```terminal
30-
curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" \
31-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
32-
--header 'Content-Type: application/ssml+xml' \
33-
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' \
34-
--header 'User-Agent: curl' \
35-
--data-raw '<speak version='\''1.0'\'' xml:lang='\''en-US'\''>
36-
<voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-JennyNeural'\''>
37-
my voice is my passport verify me
38-
</voice>
39-
</speak>' > output.mp3
30+
curl --location --request POST "https://%SPEECH_REGION%.tts.speech.microsoft.com/cognitiveservices/v1" ^
31+
--header "Ocp-Apim-Subscription-Key: %SPEECH_KEY%" ^
32+
--header "Content-Type: application/ssml+xml" ^
33+
--header "X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3" ^
34+
--header "User-Agent: curl" ^
35+
--data-raw "<speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='Female' name='en-US-JennyNeural'>my voice is my passport verify me</voice></speak>" --output output.mp3
4036
```
4137

4238
# [Linux](#tab/linux)
4339

4440
```terminal
45-
curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" ^
46-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" ^
47-
--header 'Content-Type: application/ssml+xml' ^
48-
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' ^
49-
--header 'User-Agent: curl' ^
41+
curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" \
42+
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
43+
--header 'Content-Type: application/ssml+xml' \
44+
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' \
45+
--header 'User-Agent: curl' \
5046
--data-raw '<speak version='\''1.0'\'' xml:lang='\''en-US'\''>
5147
<voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-JennyNeural'\''>
5248
my voice is my passport verify me
@@ -57,11 +53,11 @@ curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.co
5753
# [macOS](#tab/macos)
5854

5955
```terminal
60-
curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" ^
61-
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" ^
62-
--header 'Content-Type: application/ssml+xml' ^
63-
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' ^
64-
--header 'User-Agent: curl' ^
56+
curl --location --request POST "https://${SPEECH_REGION}.tts.speech.microsoft.com/cognitiveservices/v1" \
57+
--header "Ocp-Apim-Subscription-Key: ${SPEECH_KEY}" \
58+
--header 'Content-Type: application/ssml+xml' \
59+
--header 'X-Microsoft-OutputFormat: audio-16khz-128kbitrate-mono-mp3' \
60+
--header 'User-Agent: curl' \
6561
--data-raw '<speak version='\''1.0'\'' xml:lang='\''en-US'\''>
6662
<voice xml:lang='\''en-US'\'' xml:gender='\''Female'\'' name='\''en-US-JennyNeural'\''>
6763
my voice is my passport verify me

articles/cognitive-services/Speech-Service/rest-speech-to-text-short.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Use cases for the speech-to-text REST API for short audio are limited. Use it on
2020

2121
Before you use the speech-to-text REST API for short audio, consider the following limitations:
2222

23-
* Requests that use the REST API for short audio and transmit audio directly can contain no more than 30 seconds of audio. The input [audio formats](#audio-formats) are more limited compared to the [Speech SDK](speech-sdk.md).
23+
* Requests that use the REST API for short audio and transmit audio directly can contain no more than 60 seconds of audio. The input [audio formats](#audio-formats) are more limited compared to the [Speech SDK](speech-sdk.md).
2424
* The REST API for short audio returns only final results. It doesn't provide partial results.
2525
* [Speech translation](speech-translation.md) is not supported via REST API for short audio. You need to use [Speech SDK](speech-sdk.md).
2626
* [Batch transcription](batch-transcription.md) and [Custom Speech](custom-speech-overview.md) are not supported via REST API for short audio. You should always use the [Speech to Text REST API](rest-speech-to-text.md) for batch transcription and Custom Speech.

0 commit comments

Comments
 (0)