Professional Documents
Culture Documents
AI Worksheet Exp 4
AI Worksheet Exp 4
Worksheet
EXPERIMENT – 4
Aim:
Perform Speech-to-text conversion using pre trained machine learning API models for short-
form or long-form audio.
Requirements:
PC with internet connectivity, Python 3.7
Expected Outcome:
List down all the commands used
CODE:
import speech_recognition as sr
r = sr.Recognizer()
mic = sr.Microphone(device_index=1)
try:
print("Name & UID :" + r.recognize_google(audio));
except:
print("Sorry!unable to understand")
pass;
20ECP118: Foundations of AI Applications Lab
OUTPUT: