Only support CELT for now

Assert that Hybrid or Silk wasn't selected
This commit is contained in:
Sean DuBois 2022-06-12 16:02:47 -04:00
parent d6b193aba5
commit 0c432b922c
2 changed files with 6 additions and 0 deletions

View file

@ -22,5 +22,9 @@ func (d *Decoder) Decode(in []byte) (bandwidth Bandwidth, isStereo bool, frames
return 0, false, nil, fmt.Errorf("%w: %d", errUnsupportedFrameCode, tocHeader.frameCode())
}
if cfg.mode() != configurationModeCELTOnly {
return 0, false, nil, fmt.Errorf("%w: %d", errUnsupportedConfigurationMode, cfg.mode())
}
return cfg.bandwidth(), tocHeader.isStereo(), nil, nil
}

View file

@ -9,4 +9,6 @@ var (
errTooShortForArbitraryLengthFrames = errors.New("packet is too short to contain arbitrary length frames")
errArbitraryLengthFrameVBRUnsupported = errors.New("arbitrary length frames with VBR is unsupported")
errArbitraryLengthFramePaddingUnsupported = errors.New("arbitrary length frames with padding is unsupported")
errUnsupportedConfigurationMode = errors.New("unsupported configuration mode")
)