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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/webspeech/synth/test/file_speech_queue.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html lang="en-US">
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=525444
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 525444: Web Speech API, check speech synth queue</title>
    1.12 +  <script type="application/javascript">
    1.13 +    window.SimpleTest = parent.SimpleTest;
    1.14 +    window.is = parent.is;
    1.15 +    window.isnot = parent.isnot;
    1.16 +    window.ok = parent.ok;
    1.17 +  </script>
    1.18 +  <script type="application/javascript" src="common.js"></script>
    1.19 +</head>
    1.20 +<body>
    1.21 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525444">Mozilla Bug 525444</a>
    1.22 +<p id="display"></p>
    1.23 +<div id="content" style="display: none">
    1.24 +  
    1.25 +</div>
    1.26 +<pre id="test">
    1.27 +<script type="application/javascript">
    1.28 +
    1.29 +/** Test for Bug 525444 **/
    1.30 +
    1.31 +var englishJamaican = synthAddVoice('TestSpeechServiceNoAudio',
    1.32 +                                    'Bob Marley', 'en-JM', true);
    1.33 +var englishBritish = synthAddVoice('TestSpeechServiceNoAudio',
    1.34 +                                   'Amy Winehouse', 'en-GB', true);
    1.35 +var englishCanadian = synthAddVoice('TestSpeechServiceNoAudio',
    1.36 +                                    'Leonard Cohen', 'en-CA', true);
    1.37 +var frenchCanadian = synthAddVoice('TestSpeechServiceNoAudio',
    1.38 +                                   'Celine Dion', 'fr-CA', true);
    1.39 +var spanishMexican = synthAddVoice('TestSpeechServiceNoAudio',
    1.40 +                                   'Julieta Venegas', 'es-MX', true);
    1.41 +
    1.42 +synthSetDefault(englishBritish, true);
    1.43 +
    1.44 +synthTestQueue(
    1.45 +  [[{text: "Hello, world."},
    1.46 +    { uri: englishBritish }],
    1.47 +   [{text: "Bonjour tout le monde .", lang: "fr", rate: 0.5, pitch: 0.75},
    1.48 +    { uri: frenchCanadian, rate: 0.5, pitch: 0.75}],
    1.49 +   [{text: "How are you doing?", lang: "en-GB"},
    1.50 +    { rate: 1, pitch: 1, uri: englishBritish}],
    1.51 +   [{text: "¡hasta mañana", lang: "es-ES"},
    1.52 +    { uri: spanishMexican }]],
    1.53 +  function () {
    1.54 +    synthSetDefault(englishJamaican, true);
    1.55 +    var test_data = [[{text: "I shot the  sheriff."},
    1.56 +                      { uri: englishJamaican }]];
    1.57 +    var voices = speechSynthesis.getVoices();
    1.58 +    for (var i in voices) {
    1.59 +      test_data.push([{text: "Hello world", voice: voices[i]},
    1.60 +                      {uri: voices[i].voiceURI}]);
    1.61 +    }
    1.62 +
    1.63 +    synthTestQueue(test_data,
    1.64 +                   function () {
    1.65 +                     synthCleanup();
    1.66 +                     SimpleTest.finish();
    1.67 +                   });
    1.68 +  });
    1.69 +
    1.70 +
    1.71 +
    1.72 +</script>
    1.73 +</pre>
    1.74 +</body>
    1.75 +</html>

mercurial