A pure Rust no_std library for encoding and decoding timecode in real-time.
Add dependency to Cargo.toml
toml
[dependencies]
timecode-coder = { version = "0.1.0", features = ["decode_ltc"] }
Let's say you have a function that receives buffers from your audio interface:
```rust use timecodecoder::ltcdecoder::LtcDecoder;
struct MyAudioHandler {
decoder: LtcDecoder
impl MyAudioHandler {
// Sampling rate can by any Type that implements FromPrimitive
fn new(samplingrate: u32) -> Self {
Self {
decoder: LtcDecoder::new(samplingrate)
}
}
fn newbuffer(&mut self, samples: [u16; 512]) {
for sample in samples {
if let Some(timecodeframe) = gettimecodeframe(sample) {
/// New TimecodeFrame received
}
}
}
}
``
TimecodeFrame` provides:
- hours
- minutes
- seconds
- frames
- frame-rate (auto detected)
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