-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does the YT tool help in creating timestamps? #2
Comments
Timestamps as in Chapters? |
You can utilize Whisper's built-in SRT writing capability, you can use the following Python code. This example demonstrates loading a Whisper model, transcribing an audio file, and then using the from whisper.utils import get_writer
def generate_transcript(audio_file):
audio = audio_file
model = whisper.load_model("small.en") # Adjust the model size as needed
result = model.transcribe(audio=audio, language='en', word_timestamps=True, task="transcribe")
vtt_writer = get_writer(output_format='srt', output_dir='./output')
vtt_writer(result, audio) Below is an example output of the SRT writer showing the transcribed text with timestamps and sequence numbers:
|
timestamps are important metadata to be generated, so I assume you might have considered it. I checked out the --help for yt but didnt find a way to do it, is it a part of the library or planed for future dev?
The text was updated successfully, but these errors were encountered: