public class VoiceTemplate extends VoiceSdkNativePeer
This class serves as gateway to native Voice SDK implementation and allocates resources on native heap.
To release the allocated memory, AutoCloseable.close()
method should be invoked when the instance is no longer needed.
nativeId
Modifier and Type | Method and Description |
---|---|
static VoiceTemplate |
deserialize(byte[] data)
Restores VoiceTemplate object from raw bytes array.
|
protected static long |
deserialize1(byte[] data) |
ChannelType |
getChannelType()
Returns the channel type of audio record which was used to create voice template.
|
protected int |
getChannelType0() |
java.lang.String |
getInitDataId()
Returns the set of engine methods used to create this template.
|
boolean |
isValid()
Checks whether generated voice template is valid or not.
|
static VoiceTemplate |
loadFromFile(java.lang.String filepath)
Creates VoiceTemplate from file.
|
protected static long |
loadFromFile1(java.lang.String filepath) |
protected void |
release()
This method should release resources on native layer (indirectly using nativeId)
|
void |
saveToFile(java.lang.String filepath)
Saves VoiceTemplate object into file.
|
byte[] |
serialize()
Converts VoiceTemplate object into raw bytes array.
|
close, equals, finalize, hashCode
public void saveToFile(java.lang.String filepath)
filepath
- output file pathVoiceSdkEngineException
- wraps native exceptionspublic static VoiceTemplate loadFromFile(java.lang.String filepath)
filepath
- input file pathVoiceSdkEngineException
- wraps native exceptionspublic byte[] serialize()
public boolean isValid()
public ChannelType getChannelType()
public java.lang.String getInitDataId()
VoiceSdkEngineException
- wraps native exceptionspublic static VoiceTemplate deserialize(byte[] data)
data
- input bytesVoiceSdkEngineException
- wraps native exceptionsprotected static long loadFromFile1(java.lang.String filepath)
protected static long deserialize1(byte[] data)
protected void release()
VoiceSdkNativePeer
release
in class VoiceSdkNativePeer
protected int getChannelType0()