This project is a Python script that fetches a random joke from an API and converts it into speech using the gTTS library. The joke's setup and punchline are saved as separate audio files and played using the default system player.
To clone the repository to your local machine, follow the steps below:
- Open your terminal or command prompt.
- Change to the directory where you want to clone the project.
cd /path/to/destination/directory
- Copy the repository's URL. You can find it on the project's GitHub page.
- Run the
git clone
command followed by the repository URL:git clone https://github.com/thedistroyer17/JokeBox.git `
- Press Enter to execute the command.
- Git will now download the project files and create a new directory with the project name in the destination directory.
- Once the cloning process is complete, you can navigate into the project directory to access the files:
Replace
cd JokeBox
project-directory
with the actual name of the directory created during cloning. - Now you can proceed with the installation and usage instructions provided in the project's README.md file.
- Install the required dependencies by running the following command:
pip install gtts requests
- Open the terminal or command prompt.
- Navigate to the project directory.
- Run the following command:
python script.py
- The script will fetch a random joke from the API and convert it into speech.
- Two audio files will be generated:
out.mp3
containing the joke's setup andout2.mp3
containing the punchline. - The audio files will be played using the default system player.
You can modify the api_url
variable in the __main__
block of the script to change the API endpoint from which jokes are fetched.
This project is licensed under the MIT License.