i want to make app that make subtitle for videos i extract audio file as following
import sys
from moviepy.video.tools.subtitles import SubtitlesClip
from moviepy.editor import *
video = VideoFileClip(sys.argv[1])
audio = video.audio
audio.write_audiofile()
and i converted it to text but i want to record the time to make srt file .. can i record the time when there is speech in audio file or any way to make srt file from audio file , the following code is to convert audio to text
import speech_recognition as sr
AUDIO_FILE=("audi.wav")
r=sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio=r.record(source)
# sr.recognize_api()
googletext = r.recognize_google(audio)
with open("audio5.txt","w") as f:
f.write(googletext)
with open("audio.srt","w") as f:
f.write(googletext)