forge
Explore
Log in

Don't you dare go Hollow

Expose the encoder's fixed 1024-sample priming as encoder_delay()

Browse files at this commit

59ecff35584c221ba0f0c131952dc7f0deaa3435Ahmet Kaan GümüşParent: 5f3844f
  • feat
    • expose the encoder's fixed 1024-sample priming as encoder_delay()
Show full message
feat(aac-enc): expose the encoder's fixed 1024-sample priming as encoder_delay()
crates/ec-aac/src/encode.rsmodified+8 -0
@@ -125,6 +125,14 @@ pub struct AacEncoder {
125125 }
126126
127127 impl AacEncoder {
128+ /// Samples this encoder emits before the first audible one: one MDCT
129+ /// window's worth, always, because the very first frame has no previous
130+ /// block to overlap-add against and is pure priming. A muxer writing this
131+ /// track's `elst`/`CodecDelay` states it here.
132+ pub fn encoder_delay(&self) -> usize {
133+ 1024
134+ }
135+
128136 pub fn new(config: AacEncoderConfig) -> AacEncoder {
129137 AacEncoder {
130138 config,