PlatformSpeechSynthesisProviderEfl.h [plain text]
#ifndef PlatformSpeechSynthesisProviderEfl_h
#define PlatformSpeechSynthesisProviderEfl_h
#if ENABLE(SPEECH_SYNTHESIS)
#include <speak_lib.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class PlatformSpeechSynthesizer;
class PlatformSpeechSynthesisUtterance;
class PlatformSpeechSynthesisVoice;
class PlatformSpeechSynthesisProviderEfl {
public:
enum SpeechEvent {
SpeechError,
SpeechCancel,
SpeechPause,
SpeechResume,
SpeechStart
};
explicit PlatformSpeechSynthesisProviderEfl(PlatformSpeechSynthesizer*);
~PlatformSpeechSynthesisProviderEfl();
void initializeVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice>>&);
void pause();
void resume();
void speak(RefPtr<PlatformSpeechSynthesisUtterance>&&);
void cancel();
private:
bool engineInit();
int convertRateToEspeakValue(float) const;
int convertVolumeToEspeakValue(float) const;
int convertPitchToEspeakValue(float) const;
espeak_VOICE* currentVoice() const;
String voiceName(PassRefPtr<PlatformSpeechSynthesisUtterance>) const;
void fireSpeechEvent(SpeechEvent);
bool m_isEngineStarted;
PlatformSpeechSynthesizer* m_platformSpeechSynthesizer;
RefPtr<PlatformSpeechSynthesisUtterance> m_utterance;
};
}
#endif // ENABLE(SPEECH_SYNTHESIS)
#endif // PlatformSpeechSynthesisProviderEfl_h