ICohtmlSpeechSynthesizer

Cross-platform API for Synthesizer Implement it for target platforms.

#include <CohtmlSpeechSynthesizer.h>

Public Functions

Name
virtual~ICohtmlSpeechSynthesizer() =default
virtual boolInitialize() =0
Should perform any initialization work for the synthesizer.
virtual boolSpeak(const FString & Text, float Volume =1.f, float Rate =1.f, uint32 Language =0) =0
Called on worker thread Should speak the request to audio output if such functionality is supported.
virtual voidCancel() =0
Cancels speech requests and stops playing the current one if it’s playing using Speak. Expected to be called on time-sensitive threads.
virtual boolIsSpeakingOrProcessing() =0

Public Functions Documentation

function ~ICohtmlSpeechSynthesizer

virtual ~ICohtmlSpeechSynthesizer() =default

function Initialize

virtual bool Initialize() =0

Should perform any initialization work for the synthesizer.

Return: if synthesizer was initialized successfully

function Speak

virtual bool Speak(
    const FString & Text,
    float Volume =1.f,
    float Rate =1.f,
    uint32 Language =0
) =0

Called on worker thread Should speak the request to audio output if such functionality is supported.

Return: if the request was successfully scheduled to audio output

Note: return false if speaking directly to the audio output is not supported

function Cancel

virtual void Cancel() =0

Cancels speech requests and stops playing the current one if it’s playing using Speak. Expected to be called on time-sensitive threads.

function IsSpeakingOrProcessing

virtual bool IsSpeakingOrProcessing() =0

Return: if currently there is a request processing or audio playing.

Note:

  • Expected to be called on time-sensitive threads.
  • return false if Speak is not supported