{ "cells": [ { "cell_type": "markdown", "id": "d5e4fa0e", "metadata": {}, "source": [ "## Exercise 6 ##\n", "\n", "1. Text to Speech (TTS) library called pyttsx3.\n", "\n", "2. Create the following function:\n", "\n", "\n", "import pyttsx3\n", "def Talk(text,women=0):\n", " engine = pyttsx3.init()\n", " voices = engine.getProperty('voices')\n", " engine.setProperty('voice', voices[women].id) \n", " engine.say(text)\n", " engine.runAndWait()\n", "\n", "\n", "3. Read the file from the following URL: \n", "url='https://raw.githubusercontent.com/masterfloss/text/main/silly_dialog.txt'\n", "\n", "4. Use the function to read the text. If it is a boy, the Talk second parameter is 0, otherwise is 1.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "924d9efd", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }