Skip to content
Permalink
Browse files
Implement Web Speech Synthesis for Chromium
https://bugs.webkit.org/show_bug.cgi?id=111695

Reviewed by Adam Barth.

Source/Platform:

Exposes a platform API that the embedder can implement to
provide speech synthesis for the Chromium port.

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::speechSynthesizer):
* chromium/public/WebSpeechSynthesisUtterance.h: Added.
(WebKit):
(WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::~WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::operator=):
(WebKit::WebSpeechSynthesisUtterance::isNull):
* chromium/public/WebSpeechSynthesisVoice.h: Added.
(WebCore):
(WebKit):
(WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::~WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::operator=):
* chromium/public/WebSpeechSynthesizer.h: Added.
(WebKit):
(WebSpeechSynthesizer):
(WebKit::WebSpeechSynthesizer::~WebSpeechSynthesizer):
* chromium/public/WebSpeechSynthesizerClient.h: Added.
(WebKit):
(WebSpeechSynthesizerClient):
(WebKit::WebSpeechSynthesizerClient::~WebSpeechSynthesizerClient):

Source/WebCore:

Straightforward implementation of speech synthesis
for Chromium by exposing interfaces for the platform
to implement.

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::boundaryEventOccurred):
(WebCore::SpeechSynthesis::didStartSpeaking):
(WebCore::SpeechSynthesis::didPauseSpeaking):
(WebCore::SpeechSynthesis::didResumeSpeaking):
(WebCore::SpeechSynthesis::didFinishSpeaking):
(WebCore::SpeechSynthesis::speakingErrorOccurred):
(WebCore):
* Modules/speech/SpeechSynthesis.h:
(SpeechSynthesis):
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
(WebCore):
(WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance):
(WebCore::SpeechSynthesisUtterance::setVoice):
* Modules/speech/SpeechSynthesisUtterance.h:
(SpeechSynthesisUtterance):
(WebCore::SpeechSynthesisUtterance::text):
(WebCore::SpeechSynthesisUtterance::setText):
(WebCore::SpeechSynthesisUtterance::lang):
(WebCore::SpeechSynthesisUtterance::setLang):
(WebCore::SpeechSynthesisUtterance::volume):
(WebCore::SpeechSynthesisUtterance::setVolume):
(WebCore::SpeechSynthesisUtterance::rate):
(WebCore::SpeechSynthesisUtterance::setRate):
(WebCore::SpeechSynthesisUtterance::pitch):
(WebCore::SpeechSynthesisUtterance::setPitch):
(WebCore::SpeechSynthesisUtterance::startTime):
(WebCore::SpeechSynthesisUtterance::setStartTime):
(WebCore::SpeechSynthesisUtterance::platformUtterance):
* Modules/speech/SpeechSynthesisVoice.h:
(WebCore::SpeechSynthesisVoice::~SpeechSynthesisVoice):
* WebCore.exp.in:
* WebCore.gypi:
* platform/PlatformSpeechSynthesis.h:
(PlatformSpeechSynthesis):
* platform/PlatformSpeechSynthesisUtterance.cpp:
(WebCore):
(WebCore::PlatformSpeechSynthesisUtterance::create):
* platform/PlatformSpeechSynthesisUtterance.h:
(PlatformSpeechSynthesisUtterance):
(WebCore::PlatformSpeechSynthesisUtterance::setClient):
* platform/PlatformSpeechSynthesisVoice.cpp:
(WebCore):
(WebCore::PlatformSpeechSynthesisVoice::create):
(WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice):
* platform/PlatformSpeechSynthesisVoice.h:
(PlatformSpeechSynthesisVoice):
(WebCore::PlatformSpeechSynthesisVoice::setVoiceURI):
(WebCore::PlatformSpeechSynthesisVoice::setName):
(WebCore::PlatformSpeechSynthesisVoice::setLang):
(WebCore::PlatformSpeechSynthesisVoice::setLocalService):
(WebCore::PlatformSpeechSynthesisVoice::setIsDefault):
* platform/PlatformSpeechSynthesizer.cpp:
(WebCore::PlatformSpeechSynthesizer::create):
(WebCore::PlatformSpeechSynthesizer::setVoiceList):
(WebCore):
* platform/PlatformSpeechSynthesizer.h:
(WebKit):
(PlatformSpeechSynthesizerClient):
(PlatformSpeechSynthesizer):
* platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Added.
(WebCore):
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(WebCore::PlatformSpeechSynthesizer::speak):
(WebCore::PlatformSpeechSynthesizer::pause):
(WebCore::PlatformSpeechSynthesizer::resume):
(WebCore::PlatformSpeechSynthesizer::cancel):
* platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Added.
(WebKit):
(WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::operator=):
(WebKit::WebSpeechSynthesisUtterance::assign):
(WebKit::WebSpeechSynthesisUtterance::reset):
(WebKit::WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>):
(WebKit::WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*):
(WebKit::WebSpeechSynthesisUtterance::text):
(WebKit::WebSpeechSynthesisUtterance::lang):
(WebKit::WebSpeechSynthesisUtterance::voice):
(WebKit::WebSpeechSynthesisUtterance::volume):
(WebKit::WebSpeechSynthesisUtterance::rate):
(WebKit::WebSpeechSynthesisUtterance::pitch):
(WebKit::WebSpeechSynthesisUtterance::startTime):
* platform/chromium/support/WebSpeechSynthesisVoice.cpp: Added.
(WebKit):
(WebKit::WebSpeechSynthesisVoice::assign):
(WebKit::WebSpeechSynthesisVoice::reset):
(WebKit::WebSpeechSynthesisVoice::setVoiceURI):
(WebKit::WebSpeechSynthesisVoice::setName):
(WebKit::WebSpeechSynthesisVoice::setLanguage):
(WebKit::WebSpeechSynthesisVoice::setIsLocalService):
(WebKit::WebSpeechSynthesisVoice::setIsDefault):
(WebKit::WebSpeechSynthesisVoice::operator PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>):
* platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Added.
(WebCore):
(WebCore::WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl):
(WebCore::WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl):
(WebCore::WebSpeechSynthesizerClientImpl::setVoiceList):
(WebCore::WebSpeechSynthesizerClientImpl::didStartSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didFinishSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didPauseSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::didResumeSpeaking):
(WebCore::WebSpeechSynthesizerClientImpl::speakingErrorOccurred):
(WebCore::WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred):
(WebCore::WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred):
* platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Added.
(WebCore):
(WebSpeechSynthesizerClientImpl):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::speak):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock):
(WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
(WebCore::PlatformSpeechSynthesizerMock::speak):
* platform/mock/PlatformSpeechSynthesizerMock.h:
(PlatformSpeechSynthesizerMock):


Canonical link: https://commits.webkit.org/131072@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Dominic Mazzoni committed Mar 19, 2013
1 parent 998b909 commit 165b309a0bb085a68a03e5d5582c851baf99ba91
Showing 31 changed files with 1,032 additions and 71 deletions.
@@ -1,3 +1,41 @@
2013-03-19 Dominic Mazzoni <dmazzoni@google.com>

Implement Web Speech Synthesis for Chromium
https://bugs.webkit.org/show_bug.cgi?id=111695

Reviewed by Adam Barth.

Exposes a platform API that the embedder can implement to
provide speech synthesis for the Chromium port.

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::speechSynthesizer):
* chromium/public/WebSpeechSynthesisUtterance.h: Added.
(WebKit):
(WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::~WebSpeechSynthesisUtterance):
(WebKit::WebSpeechSynthesisUtterance::operator=):
(WebKit::WebSpeechSynthesisUtterance::isNull):
* chromium/public/WebSpeechSynthesisVoice.h: Added.
(WebCore):
(WebKit):
(WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::~WebSpeechSynthesisVoice):
(WebKit::WebSpeechSynthesisVoice::operator=):
* chromium/public/WebSpeechSynthesizer.h: Added.
(WebKit):
(WebSpeechSynthesizer):
(WebKit::WebSpeechSynthesizer::~WebSpeechSynthesizer):
* chromium/public/WebSpeechSynthesizerClient.h: Added.
(WebKit):
(WebSpeechSynthesizerClient):
(WebKit::WebSpeechSynthesizerClient::~WebSpeechSynthesizerClient):

2013-03-19 Mark Pilgrim <pilgrim@chromium.org>

[Chromium] Flip WEBKIT_USE_NEW_WEBFILESYSTEMTYPE
@@ -129,6 +129,10 @@
'chromium/public/WebSocketStreamHandle.h',
'chromium/public/WebSocketStreamHandleClient.h',
'chromium/public/WebSolidColorLayer.h',
'chromium/public/WebSpeechSynthesizer.h',
'chromium/public/WebSpeechSynthesizerClient.h',
'chromium/public/WebSpeechSynthesisUtterance.h',
'chromium/public/WebSpeechSynthesisVoice.h',
'chromium/public/WebStorageArea.h',
'chromium/public/WebStorageNamespace.h',
'chromium/public/WebString.h',
@@ -41,6 +41,7 @@
#include "WebGamepads.h"
#include "WebGraphicsContext3D.h"
#include "WebLocalizedString.h"
#include "WebSpeechSynthesizer.h"
#include "WebString.h"
#include "WebVector.h"

@@ -69,6 +70,8 @@ class WebRTCPeerConnectionHandler;
class WebRTCPeerConnectionHandlerClient;
class WebSandboxSupport;
class WebSocketStreamHandle;
class WebSpeechSynthesizer;
class WebSpeechSynthesizerClient;
class WebStorageNamespace;
class WebUnitTestSupport;
class WebThemeEngine;
@@ -115,6 +118,8 @@ class Platform {
// Must return non-null.
virtual WebHyphenator* hyphenator() { return 0; }

// May return null.
virtual WebSpeechSynthesizer* createSpeechSynthesizer(WebSpeechSynthesizerClient*) { return 0; }

// Audio --------------------------------------------------------------

@@ -0,0 +1,77 @@
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebSpeechSynthesisUtterance_h
#define WebSpeechSynthesisUtterance_h

#include "WebCommon.h"
#include "WebPrivatePtr.h"
#include "WebString.h"

namespace WebCore { class PlatformSpeechSynthesisUtterance; }

namespace WebKit {

class WebSpeechSynthesisUtterance {
public:
WebSpeechSynthesisUtterance() { }
WebSpeechSynthesisUtterance(const WebSpeechSynthesisUtterance& other) { assign(other); }
~WebSpeechSynthesisUtterance() { reset(); }

WebSpeechSynthesisUtterance& operator=(const WebSpeechSynthesisUtterance& other)
{
assign(other);
return *this;
}

WEBKIT_EXPORT void assign(const WebSpeechSynthesisUtterance&);
WEBKIT_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }

WEBKIT_EXPORT WebString text() const;
WEBKIT_EXPORT WebString lang() const;
WEBKIT_EXPORT WebString voice() const;

// As defined in: https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
WEBKIT_EXPORT float volume() const; // 0...1, 1 is default
WEBKIT_EXPORT float rate() const; // 0.1...10, 1 is default
WEBKIT_EXPORT float pitch() const; // 0...2, 1 is default

WEBKIT_EXPORT double startTime() const; // In seconds.

#if WEBKIT_IMPLEMENTATION
WebSpeechSynthesisUtterance(const PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>&);
WebSpeechSynthesisUtterance& operator=(WebCore::PlatformSpeechSynthesisUtterance*);
operator PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>() const;
operator WebCore::PlatformSpeechSynthesisUtterance*() const;
#endif

private:
WebPrivatePtr<WebCore::PlatformSpeechSynthesisUtterance> m_private;
};

} // namespace WebKit

#endif // WebSpeechSynthesisUtterance_h
@@ -0,0 +1,70 @@
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebSpeechSynthesisVoice_h
#define WebSpeechSynthesisVoice_h

#include "WebCommon.h"
#include "WebPrivatePtr.h"
#include "WebString.h"

namespace WebCore {
class PlatformSpeechSynthesisVoice;
}

namespace WebKit {

class WebSpeechSynthesisVoice {
public:
WebSpeechSynthesisVoice() { }
WebSpeechSynthesisVoice(const WebSpeechSynthesisVoice& other) { assign(other); }
~WebSpeechSynthesisVoice() { reset(); }

WebSpeechSynthesisVoice& operator=(const WebSpeechSynthesisVoice& other)
{
assign(other);
return *this;
}

WEBKIT_EXPORT void assign(const WebSpeechSynthesisVoice&);
WEBKIT_EXPORT void reset();

WEBKIT_EXPORT void setVoiceURI(const WebString&);
WEBKIT_EXPORT void setName(const WebString&);
WEBKIT_EXPORT void setLanguage(const WebString&);
WEBKIT_EXPORT void setIsLocalService(bool);
WEBKIT_EXPORT void setIsDefault(bool);

#if WEBKIT_IMPLEMENTATION
operator WTF::PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const;
#endif

private:
WebPrivatePtr<WebCore::PlatformSpeechSynthesisVoice> m_private;
};

} // namespace WebKit

#endif // WebSpeechSynthesisVoice_h
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebSpeechSynthesizer_h
#define WebSpeechSynthesizer_h

#include "WebCommon.h"

namespace WebKit {

class WebSpeechSynthesizerClient;
class WebSpeechSynthesisUtterance;

class WebSpeechSynthesizer {
public:
virtual ~WebSpeechSynthesizer() { }

virtual void updateVoiceList() = 0;

// OK to call with more than one utterance, will queue.
virtual void speak(const WebSpeechSynthesisUtterance&) = 0;

virtual void pause() = 0;
virtual void resume() = 0;
virtual void cancel() = 0;
};

} // namespace WebKit

#endif // WebSpeechSynthesizer_h
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebSpeechSynthesizerClient_h
#define WebSpeechSynthesizerClient_h

#include "WebSpeechSynthesisUtterance.h"
#include "WebSpeechSynthesisVoice.h"
#include "WebVector.h"

namespace WebKit {

class WebSpeechSynthesizerClient {
public:
virtual ~WebSpeechSynthesizerClient() { }

virtual void setVoiceList(const WebVector<WebSpeechSynthesisVoice>&) = 0;
virtual void didStartSpeaking(const WebSpeechSynthesisUtterance&) = 0;
virtual void didPauseSpeaking(const WebSpeechSynthesisUtterance&) = 0;
virtual void didResumeSpeaking(const WebSpeechSynthesisUtterance&) = 0;
virtual void didFinishSpeaking(const WebSpeechSynthesisUtterance&) = 0;
virtual void speakingErrorOccurred(const WebSpeechSynthesisUtterance&) = 0;
virtual void wordBoundaryEventOccurred(const WebSpeechSynthesisUtterance&, unsigned charIndex) = 0;
virtual void sentenceBoundaryEventOccurred(const WebSpeechSynthesisUtterance&, unsigned charIndex) = 0;
};

} // namespace WebKit

#endif // WebSpeechSynthesizerClient_h

0 comments on commit 165b309

Please sign in to comment.