### Initialize and use ResponsiveVoice SDK
Source: https://responsivevoice.org/api
Install the core package and initialize the voice instance with an API key to begin synthesizing speech.
```typescript
npm install @responsivevoice/core
import { getResponsiveVoice } from '@responsivevoice/core';
const rv = await getResponsiveVoice({
apiKey: 'YOUR_API_KEY'
});
rv.speak('Your product has a voice now.', 'UK English Female');
```
--------------------------------
### Initialize and Play Speech in Browser
Source: https://responsivevoice.org/api
Include the ResponsiveVoice library via script tag and trigger speech playback using the speak method on user interaction.
```html
```
--------------------------------
### getResponsiveVoice
Source: https://responsivevoice.org/api
Initializes the ResponsiveVoice instance using an API key and provides the speak method to convert text to speech.
```APIDOC
## getResponsiveVoice
### Description
Initializes the ResponsiveVoice service with the provided API key and returns an instance to control speech synthesis.
### Parameters
#### Request Body
- **apiKey** (string) - Required - The API key used to authenticate the request.
### Request Example
{
"apiKey": "YOUR_API_KEY"
}
## speak
### Description
Triggers the text-to-speech engine to read the provided text using the specified voice profile.
### Parameters
- **text** (string) - Required - The text content to be spoken.
- **voice** (string) - Required - The name of the voice profile to use (e.g., 'UK English Female').
```
--------------------------------
### speak(text, voice, params)
Source: https://responsivevoice.org/api
Initiates speech playback for the provided text using the specified voice and optional parameters.
```APIDOC
## speak(text, voice, params)
### Description
Speak text in a selected voice with pitch, rate, volume, and callbacks.
### Parameters
- **text** (string) - Required - The text to be spoken.
- **voice** (string) - Optional - The name of the voice to use.
- **params** (object) - Optional - Configuration parameters including pitch, rate, volume, and callbacks.
```
--------------------------------
### pause() / resume()
Source: https://responsivevoice.org/api
Controls the playback state of long passages.
```APIDOC
## pause() / resume()
### Description
Control long passages and user-driven playback.
```
--------------------------------
### getVoices()
Source: https://responsivevoice.org/api
Retrieves a list of voices available to the current integration.
```APIDOC
## getVoices()
### Description
List voices available to the current integration.
```
--------------------------------
### setTextReplacements()
Source: https://responsivevoice.org/api
Configures custom pronunciation replacements.
```APIDOC
## setTextReplacements()
### Description
Tune pronunciation with custom replacements.
```
--------------------------------
### setDefaultVoice()
Source: https://responsivevoice.org/api
Sets the default voice to be used for subsequent speak calls.
```APIDOC
## setDefaultVoice()
### Description
Set the default voice for repeated calls.
```
--------------------------------
### cancel()
Source: https://responsivevoice.org/api
Stops any active speech playback.
```APIDOC
## cancel()
### Description
Stop active speech playback.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.