Sep-03-2019, 12:07 PM
(This post was last modified: Sep-03-2019, 12:07 PM by DeanAseraf1.)
Hi
this is my code:
this is my code:
import speech_recognition as sr r = sr.Recognizer() with sr.AudioFile("PATH") as source: audio = r.record(source) try: sent = r.recognize_google(audio) print(sent) except LookupError: print("Could not understand audio")the output prints all the words that said in the audio in a long string like this:
Output:now i know everything[...]
i would like to know if there is a way to print each word individually and after that print the start and the end times that this word was said, like this:Output:now
startTime = 1.3s
endTime = 1.4s
i
startTime = 1.6s
endTime = 1.65s
[...]
I'm using python 3 in Pycharm and i'm using speech_recognition.