You are on page 1of 2

ISRA UNIVERSITY

Department of Computer Science

(CSAI-412) Artificial Intelligence


Lab Task # 5
Fall 2023
Instructor: Areeba Naeem
Date: 31-JAN-2023
WEEK # 5

Build your own Audio Book using AI


(Text-to-Speech)
Task # 1
Step no# 1:
Install pip install gTTS in prompt command
C:\Python\Python37\Scripts>pip install gTTS

Step no# 2:
Write down the following code:

The above code is importing a library and creating a variable which is calling and
receiving a sound of HELLO and saving it in variable tts.

Task # 2
Make the above program using function. Pass a string variable to a function which
carries the text and convert it into speech. Audio should play “I am using Artificial
Intelligence to create text to speech”.
Task # 3
Step no# 1:
C:\Python\Python37\Scripts>pip install gTTS
Install in terminal pip install pyttsx3

Step no# 2:
Write down the following code:

Task # 4
Make the program using pyttsx3 library. Audio should play “Mobilizing others to
achieve purpose under conditions of uncertainty—what leaders do—challenges the
hands, the head, and the heart. ”

You might also like