fvtt-module-narrator-tools icon indicating copy to clipboard operation
fvtt-module-narrator-tools copied to clipboard

[Feature] Consider Text to Speech

Open hmqgg opened this issue 4 years ago • 2 comments

As narrator tools, it makes sense to provide TTS feature (with options to enable/disable).

TTS interfaces should be able to integrate with many third party APIs inc. AWS/Azure/GCP and more.

hmqgg avatar Jan 29 '21 14:01 hmqgg

If this module could be made to work together with the Elevenlabs for Foundry module, you could have an Elevenlabs voice the GM chooses read the narrated text, and that would be awesome.

Armandeus66 avatar Sep 01 '23 08:09 Armandeus66

I asked on the Foundry Discord, macro-polo channel, and Zhell kindly gave me a macro to do what I described. I will explain here.

You will need the Elevenlabs for Foundry module, Narrator Tools, and the API key from your Elevenlabs subscription (to be entered in the module settings).

First make a new script macro and paste this into it. Save the macro.

const text = event.target.closest("P").nextElementSibling.innerText; ui.chat.processMessage(/playsound [Mimi] "${text}"); ui.chat.processMessage(/narrate "${text}"); //Put the Elevenlabs voice name in the [] in this macro. Put text to be read in the next paragraph after the journal link. The contents of the link description {} are not read, and can be anything.

(You can change /narrate to /describe if you like.)

This macro works only for the voice specified in the square brackets, so using this method you'll need a macro for each voice you will use.

Then edit a journal and drag the script macro onto the editing window to make a link to it. Write what you want it to read in the next paragraph. Save the page and click the link to hear the text read in that voice.

Armandeus66 avatar Sep 10 '23 20:09 Armandeus66