Package net.idrnd.voicesdk.core.common
Class VoiceTemplate
java.lang.Object
net.idrnd.voicesdk.common.VoiceSdkNativePeer
net.idrnd.voicesdk.core.common.VoiceTemplate
- All Implemented Interfaces:
AutoCloseable
Represents the result of audio data processing that can be used for similarity checks.
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic VoiceTemplatedeserialize(byte[] data) Restores VoiceTemplate object from raw bytes array.Returns the channel type of audio record which was used to create voice template.Returns the set of engine methods used to create this template.booleanisValid()Checks whether generated voice template is valid or not.static VoiceTemplateloadFromFile(String filepath) Creates VoiceTemplate from file.voidsaveToFile(String filepath) Saves VoiceTemplate object into file.byte[]Converts VoiceTemplate object into raw bytes array.Methods inherited from class net.idrnd.voicesdk.common.VoiceSdkNativePeer
close, equals, hashCode
-
Method Details
-
saveToFile
Saves VoiceTemplate object into file.- Parameters:
filepath- output file path- Throws:
VoiceSdkEngineException- wraps native exceptions
-
loadFromFile
Creates VoiceTemplate from file.- Parameters:
filepath- input file path- Returns:
- Newly created VoiceTemplate object
- Throws:
VoiceSdkEngineException- wraps native exceptions
-
serialize
public byte[] serialize()Converts VoiceTemplate object into raw bytes array.- Returns:
- Byte array
-
isValid
public boolean isValid()Checks whether generated voice template is valid or not.- Returns:
- Boolean value which is true if VoiceTemplate is valid and false otherwise
-
getChannelType
Returns the channel type of audio record which was used to create voice template.- Returns:
- Voice template channel type
-
getInitDataId
Returns the set of engine methods used to create this template.- Returns:
- Init data ID
- Throws:
VoiceSdkEngineException- wraps native exceptions
-
deserialize
Restores VoiceTemplate object from raw bytes array.- Parameters:
data- input bytes- Returns:
- Newly created VoiceTemplate object
- Throws:
VoiceSdkEngineException- wraps native exceptions
-