#srt #transcription #caption #web-vtt #deepgram

deepgram-rust-captions

Rust implementation of Deepgram's WebVTT and SRT formatting

1 unstable release

0.1.2 Jul 13, 2024

#6 in #captions

Download history 4/week @ 2024-09-20 1/week @ 2024-09-27 3/week @ 2024-11-01 1/week @ 2024-11-08 9/week @ 2024-11-29 40/week @ 2024-12-06 18/week @ 2024-12-13

67 downloads per month

MIT license

3MB
175 lines

Deepgram Rust Captions

This package is the Rust implementation of Deepgram's WebVTT and SRT formatting. Given a transcription, this package can return a valid string to store as WebVTT or SRT caption files.

This implmentation is based (a direct port) on Deepgram's Python implementation of the same functionality. The original Python implementation can be found here.

Installation

Use cargo to install the package:

cargo add deepgram-rust-captions

Usage

use deepgram_rust_captions::{converters::DeepgramConverter, srt::srt, webvtt::webvtt};
use deepgram::transcription::prerecorded::Response as DGResponse;


fn main() {
    let response: DGResponse  = ... 
    let converter = DeepgramConverter::new(&response);
    let srt_caption = srt(&converter, Some(10));
    let webvtt_caption = webvtt(&converter, Some(10));
    println!("{}", srt_caption);
    println!("{}", webvtt_caption);
}

Dependencies

~10–22MB
~289K SLoC