Code Monkey home page Code Monkey logo

textspeechbookmarklet's Introduction

Text Speech Bookmarklet

ウェブブラウザ内のテキストを読み上げるブックマークレット。

ウェブブラウザ(Chrome, Firefox)に備わっている speechSynthesis の機能を使用する。

特徴

  • ウェブブラウザ内のテキスト読み上げ。
  • 言語の自動判定(英語/日本語/ドイツ語/スペイン語/フランス語/ヒンディー語/インドネシア語/イタリア語/韓国語/オランダ語/ポーランド語/ポルトガル語/ロシア語/**語)。
  • 再生位置に自動スクロール(英語と日本語のみ)。
  • 再生位置の赤枠表示(英語と日本語のみ)。
  • 再生速度の変更(1/1.25/1.5/1.75/2/4/8倍速)。

インストール

ブラウザのブックマークバーを表示させ、ブックマークバーから起動できる場所に新しいブックマーク(ブックマークレット)を作成する。

URL 欄に text_speech_bookmark.js の中身(JavaScript)を貼り付ける。名前は何でもいい。

ブックマークバーからブックマークレットを起動することで、表示中のページに対してURL欄に貼り付けたJavaScriptを実行する。

使い方

テキストの範囲を選択してブックマークレットを起動すると選択範囲のテキストを読み上げる。

テキストを選択しないでブックマークレットを起動すると中心部のテキストを選んで読み上げる。

読み上げ中にブックマークレットを起動すると読み上げを停止する。

右下のボタンから、一時停止、選択範囲以降を再生、停止、再生速度の変更、位置調整(再生位置に自動スクロール)の切り替えができる。

オプション

変数configのプロパティをカスタマイズできる。

プロパティ 説明
use_shortcut_space ショートカットキーのスペース(一時停止と再開)を使う。
use_shortcut_arrowright ショートカットキーの右矢印(選択範囲以降を再生)を使う。自動スクロール時は一時停止してからでないと効かない。

動作確認環境

  • Google Chrome
  • Firefox

ライセンス

MIT ライセンスで提供。

既知の不具合

  • Chromeは英語と日本語以外は不安定で、boundaryなどのイベントが動かず、赤枠が表示されない。
  • FirefoxはspeechSynthesis.getVoices()が英語と日本語の2言語しか返してこないので、これら以外の言語で読み上げできない。
  • Chromeは英語と日本語以外では、少ない文字(1000文字以内)を選択範囲にしてブックマークを起動したときしか読み上げない。
  • 初回起動時だけ一時停止が効かない。

textspeechbookmarklet's People

Contributors

querykuma avatar

Stargazers

nakayama900 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.