I am trying to read a .wav file but was able to convert only 20s conversation into text. Please suggest.
# code to read .wav file
import speech_recognition as sr
r = sr.Recognizer()
audio = r"D:Fraud_Call_Detectionaudio1.wav"
with sr.AudioFile(audio) as source:
audio = r.record(source)
print ('Done!')
try:
text = (r.recognize_google(audio, language="en-HK"))
print (text)
except Exception as e:
print (e)
Output:
New contributor
Archita Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.