iOS speech synthesizer should expose names
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 15:17:06 +0000 (15:17 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 15:17:06 +0000 (15:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146319

Reviewed by Mario Sanchez Prada.

Use newer API to get the name and identifier of each voice asset.

* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185997 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm

index 9012ba0..62d16fd 100644 (file)
@@ -1,3 +1,15 @@
+2015-06-26  Chris Fleizach  <cfleizach@apple.com>
+
+        iOS speech synthesizer should expose names
+        https://bugs.webkit.org/show_bug.cgi?id=146319
+
+        Reviewed by Mario Sanchez Prada.
+
+        Use newer API to get the name and identifier of each voice asset.
+
+        * platform/ios/PlatformSpeechSynthesizerIOS.mm:
+        (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+
 2015-06-26  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [EFL] Remove unnecessary overriden methods from ScrollBarEfl
index f0e98dd..67827e8 100644 (file)
@@ -237,12 +237,15 @@ PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
 void PlatformSpeechSynthesizer::initializeVoiceList()
 {
     for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoiceClass speechVoices]) {
-        // iOS Speech voices only expose their language as an identifying aspect.
         NSString *language = [voice language];
+        bool isDefault = true;
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
+        NSString *voiceURI = [voice identifier];
+        NSString *name = [voice name];
+#else
         NSString *voiceURI = language;
         NSString *name = language;
-        bool isDefault = true;
-        
+#endif
         m_voiceList.append(PlatformSpeechSynthesisVoice::create(voiceURI, name, language, true, isDefault));
     }
 }