This is a Python application that accepts text input (via URL, text, or file), uses OpenAI's GPT-4 Turbo model to generate a response based on the prompt, and then converts the generated text to speech using Azure's Text-to-Speech API. The app is built with streamlit for an intuitive web interface.
pip install requests streamlit openai beautifulsoup4 python-dotenvClone the Repository:
git clone https://github.com/hipnologo/openai_azure_text2speech.git
cd openai_azure_text2speechConfigure Environment Variables:
Create a .env file in the project root and add your API keys:
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
AZURE_API_KEY=YOUR_AZURE_API_KEY
Run the Application: Launch the app using Streamlit:
streamlit run app.pyInput Options:
Customize Prompt Length:
Generate and Play Text-to-Speech:
en-US-AriaNeural, en-US-GuyNeural, and en-GB-RyanNeural voices for Azure TTS.We welcome contributions! To contribute:
For a detailed guide, please refer to our CONTRIBUTING.md file.
Make sure to follow the coding style and add test cases for any new code. Feel free to reach out if you have any questions.