Voiceovarian is a command-line tool written in Go that utilizes OpenAI's Text-to-Speech (TTS) model to convert written text into spoken audio. This tool allows users to input text interactively and generates corresponding voiceovers in MP3 format. The generated audio files are then played back in real-time.
Before you begin, make sure you have the following prerequisites installed:
- Go: https://golang.org/doc/install
- OpenAI API Key: Get your API key from OpenAI and set it in the environment (
.env
) variableOPENAI_API_KEY
.
# Clone the repository
git clone https://github.com/navicstein/voiceovarian.git
# Navigate to the project directory
cd voiceovarian
# Build the executable
go build -o voiceovarian .
# Set the OpenAI API key
echo "OPENAI_API_KEY=your_api_key" >> .env
# Run the tool
./voiceovarian
- Utilizes OpenAI's TTS Model for high-quality speech synthesis.
- Interactive command-line interface for user-friendly input.
- Real-time playback of generated voiceovers.
- Audio files are saved in the "voiceover_intros" directory for future use.
Once the tool is running, enter the text you want to convert into spoken audio when prompted. The generated audio file will be saved in the voiceover_intros
directory and played back in real-time.
$ Enter a text to speak it: Hello, this is Voiceovarian!
- github.com/joho/godotenv: For loading environment variables from a file.
- github.com/rs/zerolog: For logging.
- github.com/sashabaranov/go-openai: Go client for OpenAI API.
- github.com/ebitengine/oto/v3: For audio playback.
- github.com/hajimehoshi/go-mp3: MP3 decoding library.