Skip to content
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

Add an alternative to generate SRT and Webvtt files in Go #276

Open
andrerfcsantos opened this issue Feb 2, 2025 · 0 comments
Open

Add an alternative to generate SRT and Webvtt files in Go #276

andrerfcsantos opened this issue Feb 2, 2025 · 0 comments

Comments

@andrerfcsantos
Copy link

andrerfcsantos commented Feb 2, 2025

Proposed changes

Add an alternative to generate SRT and Webvtt files in Go as the (resp *PreRecordedResponse) ToSRT() is being deprecated.

Context

I use deepgram to generate subtitles for videos. I made a small program Go program that takes a video file, converts it to audio using ffmpeg, then uses the Deepgram Go SDK to get the transcript and generate the subtitles. It was really nice for me to be able to use the (resp *PreRecordedResponse) ToSRT() method, as it means the SDK provides me everything I need.

But with the ToSRT() method being deprecated, I felt the need to create a small python project that uses https://github.com/deepgram/deepgram-python-captions to handle the subtitle creation (see andrerfcsantos/dgram@4a0b250).

I briefly reviewed the logic in the Python SDK to generate the subtitles and I think it can be easily ported to Go.

Possible Implementations

I actually see some alternative ways to go about this. From least to most favorite (also easiest to hardest to implement):

  • Update the ToSRT() and ToWebVTT() method implementations to be synced with the Python and Javascript ones and remove them from being deprecated OR
  • Deprecate the ToSRT() and ToWebVTT() methods, but provide a different way in the SDK to generate SRT and and WebVTT. This new way to create subtitles inside the SDK could mimic the structure describe in the Subtitles made easy article where there would be the concept of converters that are then passed into SRT() and WebVTT() functions OR
  • Create a separate deepgram-go-captions project that would effectively be the same as https://github.com/deepgram/deepgram-python-captions or https://github.com/deepgram/deepgram-js-captions, but in Go. The nice thing about this option, is that this project could provide a library for other Go projects to use, but also provide a small executable to create subtitles.

I'm happy to work on any of these alternatives. Just wondering what would be best option for the ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant