VoiceSDK  5.0.2
speech.h
Go to the documentation of this file.
1 /* Copyright 2017 ID R&D Inc. All Rights Reserved. */
2 
3 #pragma once
4 #include <voicesdk/core/config.h>
5 #include "speech_summary.h"
6 
7 #include <vector>
8 #include <memory>
9 #include <iostream>
10 
11 namespace voicesdk {
12 
17  public:
18 
19  using Ptr = std::shared_ptr<SpeechEndpointDetector>;
20 
30  static SpeechEndpointDetector::Ptr create(
31  size_t minSpeechLengthMs,
32  size_t maxSilenceLengthMs,
33  size_t sampleRate);
34 
38  virtual void reset() = 0;
39 
47  virtual void addSamples(const uint8_t* bytes, size_t bytesNum) = 0;
48 
56  virtual void addSamples(const float* samples, size_t samplesNum) = 0;
57 
65  virtual void addSamples(const int16_t* samples, size_t samplesNum) = 0;
66 
71  virtual bool isSpeechEnded() = 0;
72 
73  virtual ~SpeechEndpointDetector() = default;
74  };
75 
80  public:
81 
82  using Ptr = std::shared_ptr<SpeechEndpointDetectorOpus>;
83 
93  static SpeechEndpointDetectorOpus::Ptr create(
94  size_t minSpeechLengthMs,
95  size_t maxSilenceLengthMs,
96  size_t sampleRate);
97 
101  virtual void reset() = 0;
102 
111  virtual void addPacket(const uint8_t *bytes, size_t bytesNum) = 0;
112 
117  virtual bool isSpeechEnded() = 0;
118 
119  virtual ~SpeechEndpointDetectorOpus() = default;
120  };
121 }
Speech endpoint detector class (interface), intended to detect speech end in the Opus audio stream...
Definition: speech.h:79
Definition: intervals.h:8
std::shared_ptr< SpeechEndpointDetectorOpus > Ptr
Definition: speech.h:82
#define VOICE_SDK_API
Definition: config.h:21
std::shared_ptr< SpeechEndpointDetector > Ptr
Definition: speech.h:19
Speech endpoint detector class (interface), intended to detect speech end in the audio stream...
Definition: speech.h:16