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
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply
#4
hello, I hope u well,
do u know how to solve it?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to find tags using specific text (timestamps) in a url? q988988 1 1,333 Mar-08-2022, 08:09 AM
Last Post: buran
  Continous Speech Recognition dell91 0 1,807 Oct-29-2020, 10:51 AM
Last Post: dell91
Bug Help on Flagging Timestamps Daring_T 2 1,827 Oct-28-2020, 08:11 PM
Last Post: Daring_T
  text to speech Heyjoe 11 6,628 Jul-02-2020, 01:32 AM
Last Post: Heyjoe
  Googles Text to speech justindiaz7474 0 1,629 May-06-2020, 02:04 AM
Last Post: justindiaz7474
  Python Speech recognition, word by word AceScottie 6 15,860 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,192 Apr-08-2020, 02:13 AM
Last Post: Helloworld20
  Python Speech Engines? Robo_Pi 2 2,059 Mar-12-2020, 02:46 PM
Last Post: Robo_Pi
  Speech Recognition Ash23733 1 8,529 Dec-12-2018, 10:00 PM
Last Post: nilamo
  Removing timestamps from transcriptions jehoshua 5 4,683 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