Class SPXEmbeddedSpeechConfiguration

Declaration

@class SPXEmbeddedSpeechConfiguration : NSObject;

Description

Class that defines embedded (offline) speech configuration.

Methods

initFromPath:error:

Creates an instance of the embedded speech config with a specified offline model path.

- (instancetype _Nullable)initFromPath:(NSString * _Nonnull)path
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • path - The folder path to search for offline models. This can be a root path under which several models are located in subfolders, or a direct path to a specific model folder.
  • outError - The error information.

Returns

An instance of the embedded speech config.

initFromPath:

Creates an instance of the embedded speech config with a specified offline model path.

- (instancetype _Nullable)initFromPath:(NSString * _Nonnull)path

Parameters

  • path - The folder path to search for offline models. This can be a root path under which several models are located in subfolders, or a direct path to a specific model folder.

Returns

An instance of the embedded speech config.

initFromPaths:error:

Creates an instance of the embedded speech config with specified offline model paths.

- (instancetype _Nullable)initFromPaths:(NSArray<NSString *> * _Nonnull)paths
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • paths - The folder paths to search for offline models. These can be root paths under which several models are located in subfolders, or direct paths to specific model folders.
  • outError - The error information.

Returns

An instance of the embedded speech config.

initFromPaths:

Creates an instance of the embedded speech config with specified offline model paths.

- (instancetype _Nullable)initFromPaths:(NSArray<NSString *> * _Nonnull)paths

Parameters

  • paths - The folder paths to search for offline models. These can be root paths under which several models are located in subfolders, or direct paths to specific model folders.

Returns

An instance of the embedded speech config.

speechSynthesisOutputFormat

Get the speech synthesis output format.

- (NSString * _Nonnull)speechSynthesisOutputFormat

setSpeechSynthesisOutputFormat:

Sets the speech synthesis output format (e.g. Riff16Khz16BitMonoPcm).

- (void)setSpeechSynthesisOutputFormat:(SPXSpeechSynthesisOutputFormat)format

Parameters

  • format - The speech synthesis output format.

setSpeechRecognitionModel:key:

Sets the model for speech recognition.

- (void)setSpeechRecognitionModel:(NSString * _Nonnull)name key:(NSString * _Nonnull)key

Parameters

  • name - The model name.
  • key - The model decryption key.

setSpeechSynthesisVoice:key:

Sets the voice for embedded speech synthesis.

- (void)setSpeechSynthesisVoice:(NSString * _Nonnull)name key:(NSString * _Nonnull)key

Parameters

  • name - The voice name of the embedded speech synthesis.
  • key - The decryption key.

setSpeechTranslationModel:key:

Sets the model for speech translation.

- (void)setSpeechTranslationModel:(NSString * _Nonnull)name key:(NSString * _Nonnull)key

Parameters

  • name - The model name.
  • key - The model decryption key.

getPropertyByName:

Returns the property value. If the name is not available, it returns an empty string.

- (NSString * _Nullable)getPropertyByName:(NSString * _Nonnull)name

Parameters

  • name - property name.

Returns

value of the property.

setPropertyTo:byName:

Sets the property value by name.

- (void)setPropertyTo:(NSString * _Nonnull)value byName:(NSString * _Nonnull)name

Parameters

  • value - value of the property.
  • name - property name.

getPropertyById:

Returns the property value. If the specified id is not available, it returns an empty string.

- (NSString * _Nullable)getPropertyById:(SPXPropertyId)propertyId

Parameters

  • propertyId - property id.

Returns

value of the property.

setPropertyTo:byId:

Sets the property value by property id.

- (void)setPropertyTo:(NSString * _Nonnull)value byId:(SPXPropertyId)propertyId

Parameters

  • value - value of the property.
  • propertyId - property id.

Properties

speechRecognitionModelName

@property (readwrite, copy, nonatomic) NSString * _Nullable speechRecognitionModelName;

The model name for speech recognition.

speechRecognitionOutputFormat

@property (assign, readwrite, nonatomic, unsafe_unretained) SPXOutputFormat speechRecognitionOutputFormat;

The speech recognition output format.

profanityOption

@property (assign, readwrite, nonatomic, unsafe_unretained) SPXSpeechConfigProfanityOption profanityOption;

The profanity option for speech recognition.

speechSynthesisVoiceName

@property (readwrite, copy, nonatomic) NSString * _Nullable speechSynthesisVoiceName;

The voice name for embedded speech synthesis.

speechTranslationModelName

@property (readwrite, copy, nonatomic) NSString * _Nullable speechTranslationModelName;

The model name for speech translation.

speechRecognitionModelsInfo

@property (readonly, copy, nonatomic) NSArray<SPXSpeechRecognitionModelInfo *> * _Nonnull speechRecognitionModelsInfo;

Available speech recognition models.

speechTranslationModelsInfo

@property (readonly, copy, nonatomic) NSArray<SPXSpeechTranslationModelInfo *> * _Nonnull speechTranslationModelsInfo;

Available speech translation models.