content/media/webspeech/synth/test/file_speech_queue.html

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE HTML>
     2 <html lang="en-US">
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=525444
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 525444: Web Speech API, check speech synth queue</title>
     9   <script type="application/javascript">
    10     window.SimpleTest = parent.SimpleTest;
    11     window.is = parent.is;
    12     window.isnot = parent.isnot;
    13     window.ok = parent.ok;
    14   </script>
    15   <script type="application/javascript" src="common.js"></script>
    16 </head>
    17 <body>
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525444">Mozilla Bug 525444</a>
    19 <p id="display"></p>
    20 <div id="content" style="display: none">
    22 </div>
    23 <pre id="test">
    24 <script type="application/javascript">
    26 /** Test for Bug 525444 **/
    28 var englishJamaican = synthAddVoice('TestSpeechServiceNoAudio',
    29                                     'Bob Marley', 'en-JM', true);
    30 var englishBritish = synthAddVoice('TestSpeechServiceNoAudio',
    31                                    'Amy Winehouse', 'en-GB', true);
    32 var englishCanadian = synthAddVoice('TestSpeechServiceNoAudio',
    33                                     'Leonard Cohen', 'en-CA', true);
    34 var frenchCanadian = synthAddVoice('TestSpeechServiceNoAudio',
    35                                    'Celine Dion', 'fr-CA', true);
    36 var spanishMexican = synthAddVoice('TestSpeechServiceNoAudio',
    37                                    'Julieta Venegas', 'es-MX', true);
    39 synthSetDefault(englishBritish, true);
    41 synthTestQueue(
    42   [[{text: "Hello, world."},
    43     { uri: englishBritish }],
    44    [{text: "Bonjour tout le monde .", lang: "fr", rate: 0.5, pitch: 0.75},
    45     { uri: frenchCanadian, rate: 0.5, pitch: 0.75}],
    46    [{text: "How are you doing?", lang: "en-GB"},
    47     { rate: 1, pitch: 1, uri: englishBritish}],
    48    [{text: "¡hasta mañana", lang: "es-ES"},
    49     { uri: spanishMexican }]],
    50   function () {
    51     synthSetDefault(englishJamaican, true);
    52     var test_data = [[{text: "I shot the  sheriff."},
    53                       { uri: englishJamaican }]];
    54     var voices = speechSynthesis.getVoices();
    55     for (var i in voices) {
    56       test_data.push([{text: "Hello world", voice: voices[i]},
    57                       {uri: voices[i].voiceURI}]);
    58     }
    60     synthTestQueue(test_data,
    61                    function () {
    62                      synthCleanup();
    63                      SimpleTest.finish();
    64                    });
    65   });
    69 </script>
    70 </pre>
    71 </body>
    72 </html>

mercurial