Decodes LTC (Linear Timecode) audio samples into timecode values. More...
#include <ltcdecoder.h>
Classes | |
| struct | DecodedTimecode |
| Result of decoding a single LTC frame. More... | |
Public Types | |
| using | DecodedList = List< DecodedTimecode > |
| List of decoded timecode results. | |
Public Member Functions | |
| LtcDecoder (int sampleRate) | |
| Constructs an LTC decoder. | |
| ~LtcDecoder ()=default | |
| Destructor. | |
| LtcDecoder (const LtcDecoder &)=delete | |
| LtcDecoder & | operator= (const LtcDecoder &)=delete |
| LtcDecoder (LtcDecoder &&)=default | |
| LtcDecoder & | operator= (LtcDecoder &&)=default |
| int | sampleRate () const |
| Returns the configured sample rate. | |
| void | setThresholds (int8_t lower, int8_t upper) |
| Sets the hysteresis thresholds for edge detection. | |
| void | setFuzz (int fuzz) |
| Sets the timing tolerance in samples. | |
| DecodedList | decode (const int8_t *samples, size_t count) |
| Feeds raw int8_t audio samples to the decoder. | |
| DecodedList | decode (const Audio &audio) |
| Feeds an Audio object to the decoder. | |
| void | reset () |
| Clears the decoder state. | |
Decodes LTC (Linear Timecode) audio samples into timecode values.
Wraps libvtc's VtcLTCDecoder to extract SMPTE timecode from biphase-mark-encoded audio. Supports incremental decoding (audio can be fed in chunks) and detects forward/reverse playback direction.
Not copyable (owns decoder state). Movable.
| LtcDecoder::LtcDecoder | ( | int | sampleRate | ) |
Constructs an LTC decoder.
| sampleRate | Audio sample rate (e.g. 48000). |
| DecodedList LtcDecoder::decode | ( | const Audio & | audio | ) |
| DecodedList LtcDecoder::decode | ( | const int8_t * | samples, |
| size_t | count | ||
| ) |
Feeds raw int8_t audio samples to the decoder.
| samples | Pointer to int8_t audio data. |
| count | Number of samples. |
| void LtcDecoder::reset | ( | ) |
Clears the decoder state.
Use after seeking or switching sources.
|
inline |
Returns the configured sample rate.
| void LtcDecoder::setFuzz | ( | int | fuzz | ) |
Sets the timing tolerance in samples.
| fuzz | Fuzz tolerance (default: 3). |
Sets the hysteresis thresholds for edge detection.
| lower | Lower threshold (typically negative, e.g. -3). |
| upper | Upper threshold (typically positive, e.g. 3). |