Class Voice
Defined in File voice.hpp
Inheritance Relationships
Base Types
public hri::FeatureTracker
(Class FeatureTracker)public std::enable_shared_from_this< Voice >
Class Documentation
-
class Voice : public hri::FeatureTracker, public std::enable_shared_from_this<Voice>
Public Functions
-
virtual ~Voice()
-
inline std::optional<bool> isSpeaking() const
Returns speech is currently detected in this voice, ie, whether the person is currently speaking.
-
inline std::optional<std::string> speech() const
Returns the last recognised final sentence.
-
inline std::optional<std::string> incrementalSpeech() const
Returns the last recognised incremental sentence.
-
inline std::optional<std::string> locale() const
Returns the last recognised speech locale.
-
inline void onSpeaking(std::function<void(bool)> callback)
Registers a callback function, to be invoked everytime speech is detected.
See also:
Voice::onSpeech and Voice::onIncrementalSpeech to register a callback for the actual recognised speech
Voice::speech and Voice::incrementalSpeech for the last recognised speech
-
inline void onSpeech(std::function<void(const std::string&, const std::string&)> callback)
Registers a callback function, to be invoked everytime a full speech is detected.
Only final sentences for this voice are returned, for instance at the end of a sentence. The callback takes two arguments:
the recognised speech text,
the locale.
See also: Voice::onIncrementalSpeech for incremental feedback
-
inline void onSpeech(std::function<void(const std::string&)> callback)
-
inline void onIncrementalSpeech(std::function<void(const std::string&, const std::string&)> callback)
Registers a callback function, to be invoked everytime speech any speech is detected.
The callback will be triggered every time the speech recogniser returns a result, even if it is not the final result. The callback takes two arguments:
the recognised speech text,
the locale.
See also: Voice::onSpeech for final feedback
-
inline void onIncrementalSpeech(std::function<void(const std::string&)> callback)
-
virtual ~Voice()