Call Center SDK  1.11.3
voice_template.h
1 /* Copyright 2020 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 
5 #include <memory>
6 #include <string>
7 
8 #include <voicesdk/core/config.h>
9 
10 namespace voicesdk {
11 
15  enum class ChannelType {
16  MIC = 1,
17  TEL = 2,
18  MIXED = 3
19  };
20 
24  class VOICE_SDK_API VoiceTemplate {
25  public:
26 
27  using Ptr = std::shared_ptr<VoiceTemplate>;
28 
34  virtual void serialize(std::ostream &stream) const = 0;
35 
42  static Ptr deserialize(std::istream &stream);
43 
49  virtual void saveToFile(const std::string& filepath) const = 0;
50 
57  static Ptr loadFromFile(const std::string& filepath);
58 
63  virtual const ChannelType& getChannelType() const = 0;
64 
69  virtual const std::string& getInitDataId() const = 0;
70 
76  virtual bool isValid() const = 0;
77 
78  virtual ~VoiceTemplate() = default;
79  };
80 }
Class representing a voice template (voice profile)
Definition: voice_template.h:24
static Ptr loadFromFile(const std::string &filepath)
Restores voice template from the given file.
virtual const ChannelType & getChannelType() const =0
Returns voice template channel type which was specified by user on creation.
virtual void serialize(std::ostream &stream) const =0
Serializes voice template to the given stream.
static Ptr deserialize(std::istream &stream)
Deserializes voice template from the given stream.
virtual bool isValid() const =0
Checks if voice template is valid or not.
virtual void saveToFile(const std::string &filepath) const =0
Stores voice template in a file of the given path.
virtual const std::string & getInitDataId() const =0
Returns ID of the init data, which was used to create the template.