@@ -43,10 +43,10 @@ To create a Speech Resource, follow the instructions in the Azure
43
43
documentation: [ Try the Speech service for
44
44
free] ( https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started#create-a-speech-resource-in-azure ) .
45
45
46
- ### SetSubscription (string speechSubscriptionKey, string serviceRegion)
46
+ ### init (string speechSubscriptionKey, string serviceRegion)
47
47
48
48
``` js
49
- microsoft .plugin .cognitiveservices .SetSubscription (string speechSubscriptionKey,
49
+ microsoft .plugin .cognitiveservices .init (string speechSubscriptionKey,
50
50
string serviceRegion, Function successCallback, Function errorCallback)
51
51
```
52
52
@@ -58,29 +58,29 @@ subscription](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-s
58
58
For more information read [ About
59
59
regions] ( https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/get-started#about-regions )
60
60
61
- SetSubscription creates the Cognitive Services speech configuration and
61
+ init creates the Cognitive Services speech configuration and
62
62
requires the subscription and region of the Azure Speech resource.
63
63
64
- SetSubscription must be called before the plugin can be used by other
64
+ init must be called before the plugin can be used by other
65
65
method. Recommended to call the SetSubscription method in the
66
66
InitializingApp method.
67
67
68
- ###StartSpeaking (string speechText)
68
+ ### startSpeaking (string speechText)
69
69
70
70
** Speech Text** : The text that will be spoken by the audio player.
71
71
72
72
``` js
73
- microsoft .plugin .cognitiveservices .StartSpeaking (string speechText, Function
73
+ microsoft .plugin .cognitiveservices .startSpeaking (string speechText, Function
74
74
successCallback, Function errorCallback)
75
75
```
76
76
77
77
StartSpeaking uses the Speech SDK to playback the text that is sent to the
78
78
function.
79
79
80
- ### SpeakSsml (string speechText)
80
+ ### startSpeakingSSML (string speechText)
81
81
82
82
``` js
83
- microsoft .plugin .cognitiveservices .SpeakSsml (string speechText, Function
83
+ microsoft .plugin .cognitiveservices .startSpeakingSSML (string speechText, Function
84
84
successCallback, Function errorCallback)
85
85
```
86
86
@@ -95,10 +95,10 @@ synthesized speech using the text-to-speech service. Compared to plain
95
95
text, SSML allows developers to fine-tune the pitch, pronunciation,
96
96
speaking rate, volume, and more of the text-to-speech output.
97
97
98
- ### RecognizeFromMicrophone ()
98
+ ### startListening ()
99
99
100
100
``` js
101
- microsoft .plugin .cognitiveservices .RecognizeFromMicrophone (Function
101
+ microsoft .plugin .cognitiveservices .startListening (Function
102
102
successCallback, Function errorCallback)
103
103
```
104
104
@@ -114,9 +114,7 @@ processing the spoken words.
114
114
115
115
The return value is a set of string values.
116
116
117
- iOS Only.
118
-
119
- ### StopListening()
117
+ ### stopListening()
120
118
121
119
``` js
122
120
microsoft .plugin .cognitiveservices .stopListening (Function successCallback,
@@ -127,10 +125,10 @@ Stop the recognition process. No return value.
127
125
128
126
iOS Only.
129
127
130
- ### SpeakStop ()
128
+ ### stopSpeaking ()
131
129
132
130
``` js
133
- microsoft .plugin .cognitiveservices .speakStop (Function successCallback, Function errorCallback)
131
+ microsoft .plugin .cognitiveservices .stopSpeaking (Function successCallback, Function errorCallback)
134
132
```
135
133
136
134
Stops the AVPlayer from playing. No return value.
@@ -229,7 +227,7 @@ constructor(private cognitiveServices: CognitiveServices) { }
229
227
// Set the subscription information
230
228
initializeApp () {
231
229
this.platform.ready().then(() => {
232
- this .cognitiveServices .SetSubscription (
230
+ this .cognitiveServices .init (
233
231
environment .subscriptionKey ,
234
232
environment .serviceRegion ).then (
235
233
() => { },
@@ -248,7 +246,7 @@ constructor(private cognitiveServices: CognitiveServices) { }
248
246
...
249
247
250
248
// Start the recognition process (iOS only)
251
- this .cognitiveServices .RecognizeFromMicrophone ().subscribe (
249
+ this .cognitiveServices .startListening ().subscribe (
252
250
results => {
253
251
if (! results .isFinal ) {
254
252
matches = results .result ;
@@ -264,22 +262,22 @@ constructor(private cognitiveServices: CognitiveServices) { }
264
262
265
263
266
264
// Stop the recognition process (iOS only)
267
- this .cognitiveServices .StopListening ();
265
+ this .cognitiveServices .stopListening ();
268
266
269
267
// Speak the text in the StartSpeaking variable
270
- this .cognitiveServices .StartSpeaking (textToSpeak ).then (
268
+ this .cognitiveServices .startSpeaking (textToSpeak ).then (
271
269
() => {},
272
270
(error : any ) => {alert (error );}
273
271
);
274
272
275
273
// Speak using the SSML xml values
276
- this .cognitiveServices .SpeakSsml (speakSsml ).then (
274
+ this .cognitiveServices .startSpeakingSsml (speakSsml ).then (
277
275
() => {},
278
276
(error : any ) => {alert (error ); }
279
277
);
280
278
281
279
// Stop the speaking process (iOS only)
282
- this .cognitiveServices .SpeakStop ();
280
+ this .cognitiveServices .stopSpeaking ();
283
281
` ` `
284
282
285
283
## Ionic Native
@@ -319,7 +317,7 @@ permission
319
317
320
318
The Java SDK for Android is packaged as an AAR (Android Library), which
321
319
includes the necessary libraries and required Android permissions. The
322
- Speech AAR is included with the plugin code .
320
+ Speech AAR is downloaded during the installation process using gradle .
323
321
324
322
### Files
325
323
@@ -334,8 +332,6 @@ client-sdk-1.8.0 AAR dependency
334
332
The following file is found under the cognitiveServicesPlugin/aar
335
333
directory:
336
334
337
- - **client-sdk-1.8.0.aar** -- The Cognitive Services Android Library
338
-
339
335
### Further readings
340
336
341
337
- <https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-sdk#android>
0 commit comments