Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

transcript with timestamps in python

import os
import sys
import speech_recognition as sr

with open("~/Documents/speech-to-text/speech2textgoogleapi.json") as f:
  GOOGLE_CLOUD_SPEECH_CREDENTIALS = f.read()
name = sys.argv[1] # wav file
r = sr.Recognizer()
all_text = []
with sr.AudioFile(name) as source:
  audio = r.record(source)
  # Transcribe audio file
  text = r.recognize_google_cloud(audio, credentials_json=GOOGLE_CLOUD_SPEECH_CREDENTIALS)
all_text.append(text)
with open("~/Documents/speech-to-text/transcript.txt", "w") as f:
  f.write(str(all_text))
Comment

PREVIOUS NEXT
Code Example
Python :: python list of deeper paths 
Python :: join mulitple dataframe pandas index 
Python :: locate certificate path python 
Python :: Search for a symmetrical inner elements of a list python 
Python :: python find in string 
Python :: load py file converted from .ui file 
Python :: input list in function and display column in dataframe python 
Python :: doormat pattern python 
Python :: imagefont cannot open resource 
Python :: python russian roulette 
Python :: pyqt fixed window size 
Python :: comparing dict key with integer 
Python :: len list python 
Python :: print prime nos from 1 to n 
Python :: python deep setter 
Python :: # str and int mixup in python: 
Python :: how to convert multiple jupyter notebook into python script with single commanf 
Python :: flask pass list to another view 
Python :: multiple channel creating command in discord.py 
Python :: Generators 
Python :: auto clipping path when upload image using python 
Python :: add label on choropleth map python 
Python :: Another example: using a colorbar to show bar height 
Python :: python load array 
Python :: formula e xiaomi 
Python :: who is bayceee roblox id 
Python :: comment enleve les chiffre duplice d une liste python 
Python :: phow to install python modules in no internet in sercer 
Python :: boolean indexing datetime object | converting string to datetime object 
Python :: JET token authentication in Django UTC 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =