VoiceTemplate

Superclass:
NSObject
Declared In:

Introduction

Represents voice template.



Methods

-getInitDataId:

Returns ID of the init data, which was used to create the template.

-initWithBytes:error:

Initializes voice template with contents of NSData obtained with [serialize] method.

-initWithPath:error:

Initializes voice template with contents of file created with [saveToFile] method..

-isValid:

Checks if voice template is valid.

-saveToFile:error:

Saves voice template to file.

-serialize:

Serializes voice template into NSData.


getInitDataId:


Returns ID of the init data, which was used to create the template.

- (NSString* _Nullable)getInitDataId:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

A string containing init data ID.


initWithBytes:error:


Initializes voice template with contents of NSData obtained with [serialize] method.

- (instancetype _Nullable)initWithBytes:(NSData* _Nonnull)bytes 
        error:(NSError* _Nullable* _Nullable)error; 
Parameters
bytes

NSData containing serialized template

error

pointer to NSError for error reporting


initWithPath:error:


Initializes voice template with contents of file created with [saveToFile] method..

- (instancetype _Nullable)initWithPath:(NSString* _Nonnull)path 
        error:(NSError* _Nullable* _Nullable)error; 
Parameters
path

path to voice template file

error

pointer to NSError for error reporting


isValid:


Checks if voice template is valid.

- (VoiceSdkBool* _Nullable)isValid:(NSError* _Nullable* _Nullable)error; 
Return Value

Boolean flag (true if template is valid or false if it is not).


saveToFile:error:


Saves voice template to file.

- (BOOL)saveToFile:(NSString* _Nonnull)path error:(NSError* _Nullable* _Nullable)error; 
Parameters
path

path to voice template file

error

pointer to NSError for error reporting

Return Value

True on success, false otherwise.


serialize:


Serializes voice template into NSData.

- (NSData* _Nullable)serialize:(NSError* _Nullable* _Nullable)error; 
Parameters
error

pointer to NSError for error reporting

Return Value

NSData object containing serialized template.