Bottom Page

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.
Quote
#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
Quote
#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
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Python Speech recognition, word by word AceScottie 6 8,003 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  Simulation of Text to speech (without using mic) to Voice recognition suported hardwa Helloworld20 2 217 Apr-08-2020, 02:13 AM
Last Post: Helloworld20
  Speech Recognition Ash23733 1 2,843 Dec-12-2018, 10:00 PM
Last Post: nilamo
  Removing timestamps from transcriptions jehoshua 5 843 Dec-09-2018, 09:27 AM
Last Post: jehoshua
  How to compare timestamps in python asad 2 4,346 Oct-24-2018, 03:56 AM
Last Post: asad
  [split] Offline audio to text (Speech Recognition) Nishant260190 0 1,967 Sep-02-2018, 12:33 PM
Last Post: Nishant260190
  Speech Recognition rajeev1729 7 3,637 Oct-06-2017, 04:25 PM
Last Post: hardik

Forum Jump:


Users browsing this thread: 1 Guest(s)