ResponsiveVoice is a popular free Speech Text API tool that allows users to add reading text, words and snippets to their website. But how to customize these codes to perform the way you want?
ResponsiveVoice despite being free, has a paid plan that supports it. The big problem is that free users don't get attention. Neither API documentation will update what the service provides.
How to add ResponsiveVoice to your website
To add ResponsiveVoice to your website, you need to create an account and generate an API key for your website. Then just put the following Script in the header of your project.
Adding parameters in responsiveVoice.Speak
To customize the ResponsiveVoice code, you can use the configuration options available in the ResponsiveVoice documentation. Some of the most common options include:
voice: Lets you specify the voice that will be used to play the text (the language). You can choose from available voices for the selected language.
rate: Allows you to control the speech rate. Higher values will result in faster speech, while lower values will result in slower speech.
pitch: Allows you to control the speech pitch. Higher values will result in higher-pitched speech, while lower values will result in lower-pitched speech.
volume: Allows you to control the speaking volume. Higher values will result in louder speech, while lower values will result in quieter speech.
To use these options, simply add them as parameters when calling the function
Adding Button to pronounce an HTML element
of the site, removes some HTML tags with regex (in my case