內容簡介
這個外掛可以在網頁上顯示一個按鈕,用來朗讀網頁內容。
僅限單頁面使用。
必須使用支援 Web Speech API 的瀏覽器。
Web Speech API 瀏覽器相容性。
範例
可以使用過濾器鈎子調整顯示位置。
add_filter( 'wp-speech-contents_mode', function () {
return 'bottom'; // top 或 bottom
});
可以使用過濾器鈎子調整要朗讀的內容。
add_filter( 'wp-speech-contents_content', function ( $content ) {
$content = preg_replace('/\pS/u','',$content); // 刪除符號等等
$content = '朗讀開始!'.$content; // 先念出 "朗讀開始!"
return $content;
});
可以使用過濾器鈎子調整要朗讀的語言。
add_filter( 'wp-speech-contents_language', function ( ) {
return 'ja-JP';
});
外掛標籤
開發者團隊
原文外掛簡介
Displays a button to speech the content.
Single page only
Web Speech API compatible browser only
Web Speech API Browser compatibility.
Example
You can change the display position with a filter hook.
add_filter( 'wp-speech-contents_mode', function () {
return 'bottom'; // top or bottom
});
You can change the content to be read out with the filter hook.
add_filter( 'wp-speech-contents_content', function ( $content ) {
$content = preg_replace('/\pS/u','',$content); // Delete symbols etc.
$content = 'Speech starts!.'.$content; // First "Speech starts!"
return $content;
});
You can Setting the language to be read out with the filter hook.
add_filter( 'wp-speech-contents_language', function ( ) {
return 'ja-JP';
});
