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
-
usesDevServer
Whether the SDK should use the Mobile Development Server (
propertyYES
) or the Mobile Production Server (NO
). This is set toNO
by default. -
vibrateOnPrompts
Whether the SDK should vibrate on the Start Recording and Stop Recording prompts.
property -
playsSuccessAndFailPrompts
Whether the SDK should play Success and Fail prompts on a successful or unsuccesful recognition.
property -
shouldDeactivateAudioSessionWhenFinished
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 -
extraServerParams
Any extra server params you want to send to the server.
property -
APIKey
Sets the APIKey to send to the server.
property
Setting and Getting the Delegate
-
delegate
Set the delegate to be notified of audio session interruptions.
property
SDK Properties
-
isBusy
Returns whether the SDK is currently busy doing something, such as performing speech recognition or speech synthesis.
property -
version
Returns the version number of the SDK. Useful for debugging purposes and bug reports.
property
Getting the SDK Instance
-
+ sharedSDK
The single instance of the iSpeechSDK class.
Getting the Configuration Instance
-
– configuration
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.
Resetting the SDK
-
– resetSDK
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.
Interruption Handling
-
– 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.
-
– endInterruption
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.
Properties
APIKey
Sets the APIKey to send to the server.
@property (nonatomic, copy) NSString *APIKey
Discussion
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.h
delegate
Set the delegate to be notified of audio session interruptions.
@property (nonatomic, unsafe_unretained) id<iSpeechSDKDelegate> delegate
Discussion
The delegate must adopt the iSpeechSDKDelegate
protocol.
Declared In
iSpeechSDK.h
extraServerParams
Any extra server params you want to send to the server.
@property (nonatomic, copy) NSString *extraServerParams
Discussion
Use only if directed.
Declared In
iSpeechSDK.h
isBusy
Returns whether the SDK is currently busy doing something, such as performing speech recognition or speech synthesis.
@property (nonatomic, assign, readonly) BOOL isBusy
Declared In
iSpeechSDK.h
playsSuccessAndFailPrompts
Whether the SDK should play Success and Fail prompts on a successful or unsuccesful recognition.
@property (nonatomic, assign) BOOL playsSuccessAndFailPrompts
Discussion
These are off by default (NO
) and will need to be turned on by setting this to YES
.
Declared In
iSpeechSDK.h
shouldDeactivateAudioSessionWhenFinished
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 shouldDeactivateAudioSessionWhenFinished
Declared In
iSpeechSDK.h
usesDevServer
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 usesDevServer
Declared In
iSpeechSDK.h
Instance 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)beginInterruption
Declared In
iSpeechSDK.h
configuration
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>)configuration
Return Value
Returns the configuration proxy.
Declared In
iSpeechSDK.h
endInterruption
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)endInterruption
Declared In
iSpeechSDK.h
resetSDK
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)resetSDK
Discussion
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