-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66ccd2c
commit 52a7e70
Showing
2 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
|
||
# Introduction | ||
|
||
This is a Node.js application that uses the Elevenlabs API, Twitch API, OpenAI API, and various Node modules to create a text-to-speech bot that can communicate with users on Twitch. The bot will respond to user input using an AI model trained by OpenAI, and it will speak the response using a custom voice generated by Elevenlabs. | ||
|
||
# Prerequisites | ||
|
||
Before running this application, you will need to make sure that you have the following prerequisites installed: | ||
|
||
- Node.js (v12.0.0 or later) | ||
- npm (v6.0.0 or later) | ||
|
||
You will also need to create accounts with the following services and obtain their respective API keys: | ||
|
||
- Elevenlabs | ||
- OpenAI | ||
- Twitch | ||
|
||
# Installation | ||
|
||
1. Clone the repository or download the code and extract it to a directory of your choice. | ||
2. Open a terminal or command prompt in the directory where the code is located. | ||
3. Run the following command to install the required packages: | ||
|
||
bash | ||
|
||
`npm install` | ||
|
||
# Configuration | ||
|
||
Before running the application, you will need to configure the following variables in the code: | ||
|
||
- `ffmpeg_path`: Path to the FFmpeg executable on your system. | ||
- `openai_apiKey`: Your OpenAI API key. | ||
- `elapiKey`: Your Elevenlabs API key. | ||
- `voiceID`: The ID of the voice you want to use for text-to-speech. | ||
- `fileName`: The name of the output file where the text-to-speech audio will be saved. | ||
- `client.identity.username`: Your Twitch bot's username. | ||
- `client.identity.password`: Your Twitch bot's OAuth token. | ||
- `client.channels`: An array of the Twitch channels where you want your bot to operate. | ||
|
||
# Running the Application | ||
|
||
To run the application, open a terminal or command prompt in the directory where the code is located and run the following command: | ||
|
||
bash | ||
|
||
`node app.js` | ||
|
||
This will start the application and connect your bot to the Twitch channels specified in the configuration. | ||
|
||
# Usage | ||
|
||
Once the application is running, your bot will respond to messages in the Twitch channels it is connected to. It will use an AI model trained by OpenAI to generate responses, and it will use a custom voice generated by Elevenlabs to speak the responses. | ||
|
||
To use the bot, simply send a message to one of the Twitch channels where the bot is connected. The bot will respond with a message generated by OpenAI, and it will speak the response using the custom voice generated by Elevenlabs. | ||
|
||
You can also test the text-to-speech functionality by running the following command in the terminal or command prompt: | ||
|
||
bash | ||
|
||
`node app.js` | ||
|
||
This will prompt you to enter a message that you want the bot to speak. The bot will speak the message using the custom voice generated by Elevenlabs. | ||
|
||
# Notes | ||
|
||
- This application requires an internet connection to operate, as it relies on external APIs and services to generate responses and speak them. | ||
- The application will save the text-to-speech audio to a file on your system. Make sure you have sufficient disk space available and that you have permission to write to the directory where the file is saved. | ||
- The application is configured to use a custom voice generated by Elevenlabs, but you can modify the code to use a different voice or a different text-to-speech service if you prefer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters