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
#2
I have same problem, i am need timestamps in speech recognizer. I am found something called google-cloud-speech whitch has this, but i dont know how to implement it, may be someone who more familiar with google cloud does
Reply
#3
@Limofeus if you have any problem, please start a new thread instead of writing in an original one which hasn't been written by you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Continous Speech Recognition dell91 0 344 Oct-29-2020, 10:51 AM
Last Post: dell91
Bug Help on Flagging Timestamps Daring_T 2 318 Oct-28-2020, 08:11 PM
Last Post: Daring_T
  Python Speech recognition, word by word AceScottie 6 10,004 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  Simulation of Text to speech (without using mic) to Voice recognition suported hardwa Helloworld20 2 680 Apr-08-2020, 02:13 AM
Last Post: Helloworld20
  Speech Recognition Ash23733 1 4,156 Dec-12-2018, 10:00 PM
Last Post: nilamo
  Removing timestamps from transcriptions jehoshua 5 1,591 Dec-09-2018, 09:27 AM
Last Post: jehoshua
  How to compare timestamps in python asad 2 6,373 Oct-24-2018, 03:56 AM
Last Post: asad
  [split] Offline audio to text (Speech Recognition) Nishant260190 0 2,475 Sep-02-2018, 12:33 PM
Last Post: Nishant260190
  Speech Recognition rajeev1729 7 4,541 Oct-06-2017, 04:25 PM
Last Post: hardik

Forum Jump:

User Panel Messages

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