eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

demo.html 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
  6. <title>espeakng.js 1.49.1 Demo</title>
  7. <style>
  8. h1 {
  9. max-width: 480px;
  10. margin: 2rem auto;
  11. font-size: 150%;
  12. }
  13. form {
  14. max-width: 480px;
  15. margin: 0 auto;
  16. }
  17. .speecharg label {
  18. display: inline-block;
  19. width: 20%;
  20. }
  21. .speecharg input, .speecharg select {
  22. display: inline-block;
  23. width: calc(80% - 3rem);
  24. margin: 0;
  25. }
  26. .speecharg input {
  27. margin: 0;
  28. padding: 0;
  29. border: 0;
  30. }
  31. .speecharg button {
  32. width: 1.5rem;
  33. height: 1.5rem;
  34. margin: 0 0 0 1.5rem;
  35. display: inline-block;
  36. }
  37. .bottom {
  38. margin-top: 1rem;
  39. display: -webkit-flex;
  40. display: flex;
  41. -webkit-justify-content: space-between;
  42. justify-content: space-between;
  43. margin: 1rem 0;
  44. }
  45. .bottom button {
  46. flex-grow: 1;
  47. -webkit-flex-grow: 1;
  48. }
  49. #texttospeak {
  50. width: 100%;
  51. height: 8rem;
  52. display: block;
  53. margin-bottom: 1rem;
  54. }
  55. p.gh {
  56. color: #333;
  57. text-align: right;
  58. display: block;
  59. font-style: italic;
  60. }
  61. /* loading screen */
  62. #splash {
  63. position: absolute;
  64. top: 0;
  65. left: 0;
  66. right: 0;
  67. bottom: 0;
  68. background-color: #fff;
  69. padding-top: 4rem;
  70. transition: opacity 200ms ease, visibility 200ms;
  71. -webkit-transition: opacity 200ms ease, visibility 200ms;
  72. visibility: hidden;
  73. opacity: 0;
  74. }
  75. body.loading #splash {
  76. visibility: visible;
  77. opacity: 1;
  78. }
  79. #splash > * {
  80. width: 10rem;
  81. max-width: 480px;
  82. margin: 2rem auto;
  83. display: block;
  84. text-align: center;
  85. }
  86. body.loading > *:not(#splash) {
  87. visibility: hidden;
  88. }
  89. </style>
  90. <script type="text/javascript" src="js/espeakng.js"></script>
  91. <script type="text/javascript" src="js/demo.js"></script>
  92. </head>
  93. <body class="loading">
  94. <div id="splash">
  95. <div>Loading eSpeak-ng worker and data...</div>
  96. <progress></progress>
  97. </div>
  98. <h1>espeakng.js 1.49.1 Demo</h1>
  99. <form>
  100. <textarea id="texttospeak">Call me Ishmael. Some years ago --- never mind how long precisely --- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation.</textarea>
  101. <div class="speecharg">
  102. <label for="pitch">Pitch</label><input id="pitch" type="range" value="50" min="0" max="100" /><button type="button" aria-label="Reset pitch" title="Reset pitch" onclick="resetPitch();">&#x21b6;</button>
  103. </div>
  104. <div class="speecharg">
  105. <label for="rate">Rate</label><input id="rate" type="range" value="175" min="80" max="450" /><button type="button" aria-label="Reset rate" title="Reset rate" onclick="resetRate();">&#x21b6;</button>
  106. </div>
  107. <div class="speecharg">
  108. <label for="voice">Voice</label><select id="voice"></select><button type="button" aria-label="Reset voice" title="Reset voice" onclick="resetVoice();">&#x21b6;</button>
  109. </div>
  110. <div class="bottom">
  111. <button type="button" onmousedown="speak();">Speak</button>
  112. <button type="button" onmousedown="stop();">Stop</button>
  113. </div>
  114. <p class="gh"><a href="https://github.com/eeejay/espeak/tree/emscripten">Original Code for eSpeak: Eitan Isaacson</a></p>
  115. <p class="gh"><a href="https://github.com/pettarin/espeak-ng/tree/emscripten">Adapted Code for eSpeak-ng: Alberto Pettarin</a></p>
  116. </form>
  117. <script type="text/javascript">
  118. initializeDemo();
  119. </script>
  120. </body>
  121. </html>