You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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):
ToSRT()
andToWebVTT()
method implementations to be synced with the Python and Javascript ones and remove them from being deprecated ORToSRT()
andToWebVTT()
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 intoSRT()
andWebVTT()
functions ORdeepgram-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.
The text was updated successfully, but these errors were encountered: