Crates.io | timecode-coder |
lib.rs | timecode-coder |
version | 0.3.0 |
source | src |
created_at | 2022-12-04 21:03:12.122906 |
updated_at | 2022-12-04 21:11:59.205293 |
description | A pure Rust no_std library for decoding and encoding timecode in real-time |
homepage | |
repository | https://github.com/michaelhugi/rust-timecode-parser |
max_upload_size | |
id | 729786 |
size | 44,830 |
A pure Rust no_std library for encoding and decoding timecode in real-time.
Add dependency to Cargo.toml
[dependencies]
timecode-coder = { version = "x.x.x", features = ["decode_ltc"] }
Let's say you have a function that receives buffers from your audio interface:
use timecode_coder::ltc_decoder::LtcDecoder;
struct MyAudioHandler {
decoder: LtcDecoder<u16>,
}
impl MyAudioHandler {
// Sampling rate can by any Type that implements `FromPrimitive`
fn new(sampling_rate: u32) -> Self {
Self {
decoder: LtcDecoder::new(sampling_rate)
}
}
fn new_buffer(&mut self, samples: [u16; 512]) {
for sample in samples {
if let Some(timecode_frame) = get_timecode_frame(sample) {
/// New TimecodeFrame received
}
}
}
}
TimecodeFrame
provides:
Warning. Drop frames are not yet supported. They will be detected as normal '25fps' or '30fps'
not yet implemented
not yet implemented
not yet implemented