Python Forum
Speech Recognition with timestamps
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Speech Recognition with timestamps
#1
Hi
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.
Reply


Messages In This Thread
Speech Recognition with timestamps - by DeanAseraf1 - Sep-03-2019, 12:07 PM
RE: Speech Recognition with timestamps - by gh_ad - Jun-27-2021, 06:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find tags using specific text (timestamps) in a url? q988988 1 1,396 Mar-08-2022, 08:09 AM
Last Post: buran
  Continous Speech Recognition dell91 0 1,851 Oct-29-2020, 10:51 AM
Last Post: dell91
Bug Help on Flagging Timestamps Daring_T 2 1,906 Oct-28-2020, 08:11 PM
Last Post: Daring_T
  text to speech Heyjoe 11 6,897 Jul-02-2020, 01:32 AM
Last Post: Heyjoe
  Googles Text to speech justindiaz7474 0 1,691 May-06-2020, 02:04 AM
Last Post: justindiaz7474
  Python Speech recognition, word by word AceScottie 6 16,067 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  Simulation of Text to speech (without using mic) to Voice recognition suported hardwa Helloworld20 2 2,249 Apr-08-2020, 02:13 AM
Last Post: Helloworld20
  Python Speech Engines? Robo_Pi 2 2,114 Mar-12-2020, 02:46 PM
Last Post: Robo_Pi
  Speech Recognition Ash23733 1 8,658 Dec-12-2018, 10:00 PM
Last Post: nilamo
  Removing timestamps from transcriptions jehoshua 5 4,818 Dec-09-2018, 09:27 AM
Last Post: jehoshua

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020