An advanced FiveM resource that brings AI-powered text-to-speech capabilities to your server using OpenAI's cutting-edge TTS API. Give your players the ability to vocalize their thoughts with realistic AI voices!
- Multiple AI voices with distinct personalities
- 6 emotional tones (happy, sad, calm, surprised, afraid, emotional)
- Smart proximity-based voice sharing
- Customizable volume controls
- Modern, user-friendly web interface
- Real-time audio generation and playback
- Automatic audio file cleanup
A FiveM resource that provides in-game text-to-speech functionality with:
- Web-based UI built with React and Tailwind CSS
- Multiple AI voices to choose from
- Different emotional tones for speech
- Proximity-based audio sharing between players
- Volume control
- Easy-to-use command system
A Node.js Express server that handles:
- OpenAI API integration for text-to-speech generation
- Audio file management and cleanup
- URL-based audio delivery
- Navigate to the server directory:
cd pth_tts_ai_srv- Install dependencies:
npm install- Configure environment variables by creating a
.envfile:
OPENAI_API_KEY=your_openai_api_key
PORT=3000
AUDIO_EXPIRATION=5
AUDIO_SCHEDULE_CLEANUP=30
MODEL_TTS=gpt-4o-mini-tts- Start the server:
node express-tts-server.js-
Copy the
pth_tts_aifolder to your FiveM server's resources directory -
Add to your server.cfg:
ensure pth_tts_ai- If developing the web UI, navigate to the web directory:
cd pth_tts_ai/web
npm install
npm run build- In-game, use the command
/ttsto open the TTS interface - Type your text and select:
- Voice (male/female options)
- Emotional tone
- Volume level
- Click "Read" to generate and play the speech
- Multiple AI voices (male and female options)
- Emotional tones: calm, emotional, sad, surprise, afraid, happy
- Volume control
- Proximity-based speech sharing
- Automatic audio file cleanup
- Web-based UI with React
- Real-time audio playback
SERVER_HOST: Express server address
command: Command to open TTS interfaceradius: Proximity radius for speech sharing- Voice and emotion configurations
The web UI is built with:
- React
- Tailwind CSS
- DaisyUI
- Ext Javascript
- Vite
To develop the web UI:
cd web
npm run devFound a bug or want to contribute? Please open an issue or submit a pull request!