音声合成

Windowsの音声合成エンジン のAPI

名作をコンピュータに音読させる

  1. マイクロソフトの text-to-speech (TTS) エンジンを利用す る。
  2. SpVoice インタフェー ス (Speech API 5.3)
  3. 青空文庫などから名作を選ぶ。
  4. 次のようなMicrosoft PowerShell スクリプトを利用する。

JavaScriptによる音声合成

音声合成(text to speech)

JavaScriptで、音声合成(テキストを音声に変換)する。

不思議の国のアリスをJavaScriptで読みあげる

ALICE'S ADVENTURES IN WONDERLAND (www.gutenberg.org))

  1. Alice's Adventure in Wonderland
  2. Alice's Adventures in Wonderland, English US
  3. 不思議の国のアリス, Japanese 日本語
  4. Alice's Adventure in Wonderland, English GB

Chrome のコンソールで音声のリスト表示

      speechSynthesis.getVoices()

音声合成のさまざまなパラメータ

      var msg = new SpeechSynthesisUtterance();
      var voices = window.speechSynthesis.getVoices();
      msg.voice = voices[10]; // Note: some voices don't support
      altering params
      msg.voiceURI = 'native';
      msg.volume = 1; // 0 to 1
      msg.rate = 1; // 0.1 to 10
      msg.pitch = 2; //0 to 2
      msg.text = 'Man shall not live by bread alone, but by every word
      that proceeds from the mouth of God.';
      msg.lang = 'en-US';

      msg.onend = function(e) {
      console.log('Finished in ' + event.elapsedTime + ' seconds.');
      };

      speechSynthesis.speak(msg);
    

Web Speech API Specification (dvcs.w3.org)

Web Speech API Specification Editor's Draft: 6 June 2014

Web apps that talk - introfuction to the Speech Synthesis API (Google Developers)


2016-01-10