Text to Speech
Plugin for Obsidian
Features:
- Start playback for note from statusbar and ribbon
- Only speaking selected text in edit mode:
- usable with other plugins (currently RSS Reader)
You can create language specific voices, which will be used when you have a note with
lang: {languageCode}
in the Frontmatter. The language code can be seen in the
settings and is a two letter ISO 639-1 code.
This plugin will NOT work on android due to this bug in the Webview.
Adding languages
This plugin uses the native API of your Operating System, to add a new language reference the documentation accordingly:
Installing the plugin
Settings > Third-party plugins > Community Plugins > Browseand search forText to Speech- Using the Beta Reviewers Auto-update Tester plugin with the repo
path:
joethei/obsidian-tts - Copy over
main.js,styles.css,manifest.jsonfrom the releases to your vaultVaultFolder/.obsidian/plugins/obsidian-tts/.
API
You can use this plugins API to add Text to Speech capabilities to your plugin.
//@ts-ignore
if (this.app.plugins.plugins["obsidian-tts"]) {//check if the plugin is loaded
//@ts-ignore
const tts = this.app.plugins.plugins["obsidian-tts"].ttsService;
await tts.say(title, text, language);//language is optional, use a ISO 639-1 code
tts.pause();
tts.resume();
tts.stop();
tts.isSpeaking();
tts.isPaused();
}