Call Center SDK  1.11.3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
voicesdk::VoiceTemplate Class Referenceabstract

Class representing a voice template (voice profile) More...

#include <voicesdk/core/common/voice_template.h>

Public Types

using Ptr = std::shared_ptr< VoiceTemplate >
 

Public Member Functions

virtual void serialize (std::ostream &stream) const =0
 Serializes voice template to the given stream. More...
 
virtual void saveToFile (const std::string &filepath) const =0
 Stores voice template in a file of the given path. More...
 
virtual const ChannelType & getChannelType () const =0
 Returns voice template channel type which was specified by user on creation. More...
 
virtual const std::string & getInitDataId () const =0
 Returns ID of the init data, which was used to create the template. More...
 
virtual bool isValid () const =0
 Checks if voice template is valid or not. More...
 

Static Public Member Functions

static Ptr deserialize (std::istream &stream)
 Deserializes voice template from the given stream. More...
 
static Ptr loadFromFile (const std::string &filepath)
 Restores voice template from the given file. More...
 

Detailed Description

Class representing a voice template (voice profile)

Member Function Documentation

◆ deserialize()

static Ptr voicesdk::VoiceTemplate::deserialize ( std::istream &  stream)
static

Deserializes voice template from the given stream.

Parameters
streaminput stream
Exceptions
std::runtime_errorif runtime error occurred
Returns
Created voice template instance

◆ getChannelType()

virtual const ChannelType& voicesdk::VoiceTemplate::getChannelType ( ) const
pure virtual

Returns voice template channel type which was specified by user on creation.

Returns
Channel type

◆ getInitDataId()

virtual const std::string& voicesdk::VoiceTemplate::getInitDataId ( ) const
pure virtual

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

Returns
A string containing init data ID

◆ isValid()

virtual bool voicesdk::VoiceTemplate::isValid ( ) const
pure virtual

Checks if voice template is valid or not.

Returns
true if voice template instance is valid, false otherwise
Deprecated:
Always returns true, will be removed in the next release

◆ loadFromFile()

static Ptr voicesdk::VoiceTemplate::loadFromFile ( const std::string &  filepath)
static

Restores voice template from the given file.

Parameters
filepathPath to the template file
Exceptions
std::runtime_errorif runtime error occurred
Returns
Created voice template instance

◆ saveToFile()

virtual void voicesdk::VoiceTemplate::saveToFile ( const std::string &  filepath) const
pure virtual

Stores voice template in a file of the given path.

Parameters
filepathPath to the output file
Exceptions
std::runtime_errorif runtime error occurred

◆ serialize()

virtual void voicesdk::VoiceTemplate::serialize ( std::ostream &  stream) const
pure virtual

Serializes voice template to the given stream.

Parameters
streamoutput stream
Exceptions
std::runtime_errorif runtime error occurred