iSpeechSDK Class Reference
| Inherits from | NSObject |
| Declared in | iSpeechSDK.h |
Overview
The shared SDK class. Configuration of the SDK happens on this object, as well as getting the configuration object to set global configuration for ISSpeechSynthesis and ISSpeechRecognition objects.
Tasks
Configuring the SDK Instance
-
usesDevServerWhether the SDK should use the Mobile Development Server (
propertyYES) or the Mobile Production Server (NO). This is set toNOby default. -
vibrateOnPromptsWhether the SDK should vibrate on the Start Recording and Stop Recording prompts.
property -
playsSuccessAndFailPromptsWhether the SDK should play Success and Fail prompts on a successful or unsuccesful recognition.
property -
shouldDeactivateAudioSessionWhenFinishedAllows you to tell the SDK whether or not it should deactivate the audio session once it’s finished its stuff. If you’re doing your own audio stuff in the app (such as playing music, an audiobook, etc.), you’d use this to make sure that your audio doesn’t go away once the SDK finishes its speech synthesis or speech recognition.
property -
extraServerParamsAny extra server params you want to send to the server.
property -
APIKeySets the APIKey to send to the server.
property
Setting and Getting the Delegate
-
delegateSet the delegate to be notified of audio session interruptions.
property
SDK Properties
-
isBusyReturns whether the SDK is currently busy doing something, such as performing speech recognition or speech synthesis.
property -
versionReturns the version number of the SDK. Useful for debugging purposes and bug reports.
property
Getting the SDK Instance
-
+ sharedSDKThe single instance of the iSpeechSDK class.
Getting the Configuration Instance
-
– configurationMethod to get the configuration object to set properties globally for all objects. For example, if you wanted to set the voice for all speech recognition requests, you’d call
[[[iSpeechSDK sharedSDK] configuration] setVoice:VOICE_HERE]and all subsequent speech recognition requests would use that voice.
Resetting the SDK
-
– resetSDKIf you get a lot of 303 errors, even though you know for a fact that the SDK isn’t doing anything, call this method to reset the SDK’s internals.
Interruption Handling
-
– beginInterruptionTells the SDK that an interruption has begun. If you initialize the audio session before the SDK, you must call this method to ensure that the SDK does not break.
-
– endInterruptionTells the SDK that an interruption has ended. If you initialize the audio session before the SDK, you must call this method to ensure that the SDK does not break.
Properties
APIKey
Sets the APIKey to send to the server.
@property (nonatomic, copy) NSString *APIKeyDiscussion
The best place to set this is once in your -applicationDidFinishLaunching: method on your app delegate. Once set, you shoudn’t have a reason to change it.
Declared In
iSpeechSDK.hdelegate
Set the delegate to be notified of audio session interruptions.
@property (nonatomic, unsafe_unretained) id<iSpeechSDKDelegate> delegateDiscussion
The delegate must adopt the iSpeechSDKDelegate protocol.
Declared In
iSpeechSDK.hextraServerParams
Any extra server params you want to send to the server.
@property (nonatomic, copy) NSString *extraServerParamsDiscussion
Use only if directed.
Declared In
iSpeechSDK.hisBusy
Returns whether the SDK is currently busy doing something, such as performing speech recognition or speech synthesis.
@property (nonatomic, assign, readonly) BOOL isBusyDeclared In
iSpeechSDK.hplaysSuccessAndFailPrompts
Whether the SDK should play Success and Fail prompts on a successful or unsuccesful recognition.
@property (nonatomic, assign) BOOL playsSuccessAndFailPromptsDiscussion
These are off by default (NO) and will need to be turned on by setting this to YES.
Declared In
iSpeechSDK.hshouldDeactivateAudioSessionWhenFinished
Allows you to tell the SDK whether or not it should deactivate the audio session once it’s finished its stuff. If you’re doing your own audio stuff in the app (such as playing music, an audiobook, etc.), you’d use this to make sure that your audio doesn’t go away once the SDK finishes its speech synthesis or speech recognition.
@property (nonatomic, assign) BOOL shouldDeactivateAudioSessionWhenFinishedDeclared In
iSpeechSDK.husesDevServer
Whether the SDK should use the Mobile Development Server (YES) or the Mobile Production Server (NO). This is set to NO by default.
@property (nonatomic, assign) BOOL usesDevServerDeclared In
iSpeechSDK.hInstance Methods
beginInterruption
Tells the SDK that an interruption has begun. If you initialize the audio session before the SDK, you must call this method to ensure that the SDK does not break.
- (void)beginInterruptionDeclared In
iSpeechSDK.hconfiguration
Method to get the configuration object to set properties globally for all objects. For example, if you wanted to set the voice for all speech recognition requests, you’d call [[[iSpeechSDK sharedSDK] configuration] setVoice:VOICE_HERE] and all subsequent speech recognition requests would use that voice.
- (id<ISConfiguration>)configurationReturn Value
Returns the configuration proxy.
Declared In
iSpeechSDK.hendInterruption
Tells the SDK that an interruption has ended. If you initialize the audio session before the SDK, you must call this method to ensure that the SDK does not break.
- (void)endInterruptionDeclared In
iSpeechSDK.hresetSDK
If you get a lot of 303 errors, even though you know for a fact that the SDK isn’t doing anything, call this method to reset the SDK’s internals.
- (void)resetSDKDiscussion
Configuration properties set, including your API key, and anything sent to [[iSpeechSDK sharedSDK] configuration] will not be affected by this call. The delegate for any active speech synthesis or speech recognition will get a kISpeechErrorCodeServerDied error code.
Warning: This is a temporary fix and will be removed for the final 1.0 relase of the SDK.
Declared In
iSpeechSDK.h