<jupyter_start><jupyter_text>Text to Speech  In this Project, we will be converting our text to speech using the 'Google Text to Speech' Library. The program will input text from a user, then play it back to them as an audio clip. Begin by installing the necessary Libraries on your computer. Skip this step if they are already installed. If you encounter any problems while installing, check online to see how to install them for your specific OS.<jupyter_code># pip install gtts
# pip install AppKit
from AppKit import NSSound
from gtts import gTTS
# Input text from a user.

inputtext=input("Type in your text here: ")
# Set the language to English.

language = 'en'
obj = gTTS(text=inputtext, lang=language, slow=False)
# Save the result as an audio file in WAV format.

obj.save("audio.wav")
# Play the audio clip.

sound = NSSound.alloc()
sound.initWithContentsOfFile_byReference_('audio.wav', True)
sound.play()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07067510548523206, 'fraction_numerical': 0.0, 'mean_word_length': 4.968553459119497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '59438', 'license': 'MIT', 'n_tokens_mistral': 280, 'n_tokens_neox': 274, 'n_words': 130, 'path': 'My Project 5 (b) - Text to Speech.ipynb', 'repo_name': 'nikita-15/10-Minute-Programs-for-Python-Beginners', 'size': '948'}