Skip to content

hipnologo/openai_azure_text2speech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI and Azure for Text-to-Speech

This is a Python script that takes the URL of a webpage as a prompt, uses OpenAI's Davinci engine to generate text from the prompt, and converts the resulted text to speech using Azure's Text-to-Speech API. The script is built using streamlit to display the results in a web interface.

License: Apache License 2.0 Forks Stars Issues GitHub contributors

Prerequisites

  • An OpenAI API key: you can get it from OpenAI's website.
  • An Azure API key: you can get it from Azure's website.
  • The requests library: you can install it using pip install requests.
  • The streamlit library: you can install it using pip install streamlit.

How to use

  1. Clone or download the repository.
  2. Replace YOUR_OPENAI_API_KEY and YOUR_AZURE_API_KEY in the code with your own API keys.
  3. Run the script using streamlit run app.py.
  4. Enter the URL of the prompt page in the input field.
  5. Set the limit for the number of characters (max tokens) to be generated by the OpenAI engine.
  6. The resulted text will be displayed in the web interface.
  7. You can listen to the text-to-speech output by playing the audio player.
  8. You can also download the audio file by clicking the "Download audio file" button.

Contributing

We welcome contributions to this project! If you have an idea for a feature or bug fix, follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Commit your changes to the new branch.
  4. Push the branch to your forked repository.
  5. Submit a pull request to the original repository.

Make sure to follow the code style and add test cases for any new code. If you have any questions, don't hesitate to ask the repository maintainers.

Buy Me A Coffee

About

Python script generates speech from a webpage URL prompt using OpenAI and Azure APIs, with Streamlit display.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages