Do we have somethins like tts?

I know that i can use audio hooks with commands, but do we have something more like tts? i found only this topic , but i don’t understand nothing… it’s actually work?
I want create paid tss command.
P.S. As always, sorry again for my bad english. Hope you get it <3

1 Like

That person wrote a custom module for TTS, you can work with them and ask them how to best get it working.

Cheers

Wow, thanks for the quick response, you awesome <3

Add the following file under BorFolder\scripts\systems

speakSystem.js (3.1 KB)

Then in BorFolder\web\alerts\js\alertHandler.js , add the following around Line #107

       //START TTS
		if (imageFile.substring(0,7) == "<voice>"){//Check if voice alert.
			var textToSpeak = imageFile.substring(7);//Remove "<voice>"
			//Pass text to window object.
			var speech = new SpeechSynthesisUtterance(textToSpeak);
			var voices = window.speechSynthesis.getVoices();
			speech.default = false;
			speech.voice = voices.filter(function(voice) { return voice.name == 'Google UK English Female'; })[0];
			speech.lang = 'en-GB';
			speech.volume = 0.70;
			window.speechSynthesis.speak(speech);
		} else {
		//END TTS

If you want to change the voice, open the following site:


and below HTML, there will be a dropdown with the available Voices and its respective language. Choose one you want and you can modify these 2 line in the code above:
speech.voice = voices.filter(function(voice) { return voice.name == ‘Google UK English Female’; })[0];
speech.lang = ‘en-GB’;

Also, you can change the price of the command for the user by modifying it in “speakSystem.js”:
var PRICE = 20;

That’s it! You need to keep http://localhost:25000/alerts open, and then type:
!say Hello world
in chat to hear the text!

1 Like

Hey, thank you a lot.
I can not check now, but this script reads dots and comas?
The script from the link above does not know how to read them.

Hi,

Here is the updated script that can read commas:

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.