ISSpeechSynthesis Class Reference
| Inherits from | NSObject |
| Declared in | ISSpeechSynthesis.h |
Tasks
Getting and Setting the Delegate
-
delegateThe delegate of a speech synthesis object.
property
Configuration Properties
-
voiceSets the voice to use for this speech synthesis instance.
property -
speedSets the speed to use for speech synthesis.
property -
bitrateThe bitrate of the synthesised speech.
property -
resumesAfterInterruptionSets whether playback will resume after an interruption.
property -
textThe text to speak.
property
Creating an Instance
-
– initWithText:Create a new
ISSpeechSynthesisobject with the supplied text.
Speaking Text
-
– speak:Speak the text that was specified when creating this instance.
-
– speakWithHandler:Speak the text that was specified when creating this instance.
-
– cancelCancels an in-progress speech synthesis action.
Properties
bitrate
The bitrate of the synthesised speech.
@property (nonatomic, assign) NSInteger bitrateDiscussion
The higher the bitrate, the better quality the audio, but the larger the file size of the data being sent, which results in more buffering needed to load all that data. Default value is 48, which is sutable for WiFi, 4G, and 3G.
Valid values include 8, 16, 24, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, and 320, as well as any others listed under “Bit Rates” for an API key’s Text-to-Speech Settings.
Declared In
ISSpeechSynthesis.hdelegate
The delegate of a speech synthesis object.
@property (nonatomic, unsafe_unretained) id<ISSpeechSynthesisDelegate> delegateDiscussion
The delegate must adopt the ISSpeechSynthesisDelegate protocol.
Declared In
ISSpeechSynthesis.hresumesAfterInterruption
Sets whether playback will resume after an interruption.
@property (nonatomic, assign) BOOL resumesAfterInterruptionDiscussion
To keep behavior consistent with older versions of the SDK, by default, this is set to NO.
Declared In
ISSpeechSynthesis.hspeed
Sets the speed to use for speech synthesis.
@property (nonatomic, assign) NSInteger speedDiscussion
This should be a number anywhere between -10 and 10, with -10 being the slowest, and 10 being the fastest. If you provide a number larger than 10, the speed will be set to 10. Likewise, if you provide a number smaller than -10, the speed will be set to -10.
Declared In
ISSpeechSynthesis.hvoice
Sets the voice to use for this speech synthesis instance.
@property (nonatomic, copy) NSString *voiceDiscussion
Voices are listed in the ISSpeechSynthesisVoices.h header file. You are not limited to that list; they are only standard voices. If you specify an invalid voice, the delegate will get an error.
Declared In
ISSpeechSynthesis.hInstance Methods
cancel
Cancels an in-progress speech synthesis action.
- (void)cancelDeclared In
ISSpeechSynthesis.hinitWithText:
Create a new ISSpeechSynthesis object with the supplied text.
- (id)initWithText:(NSString *)textParameters
- text
The initial text for the speech synthesis object.
Declared In
ISSpeechSynthesis.hspeak:
Speak the text that was specified when creating this instance.
- (BOOL)speak:(NSError **)errParameters
- err
An
NSErrorpointer to get an error object out of the method if something goes wrong.
Return Value
Whether synthesis successfully started. If this returns NO, check the error for details on what went wrong.
Declared In
ISSpeechSynthesis.hspeakWithHandler:
Speak the text that was specified when creating this instance.
- (void)speakWithHandler:(ISSpeechSynthesisHandler)handlerParameters
- handler
A
ISSpeechSynthesisHandlerblock to be executed when speaking finishes, or when an error occurs. This handler will be called on the main thread.
Declared In
ISSpeechSynthesis.h