[opus] 24 bits samples

Ralph Giles giles at thaumas.net
Tue Jun 23 08:20:52 PDT 2015

On 2015-06-23 8:04 AM, Kazem Baadpie wrote:

>  I am trying to use opus for encoding AES (spdif) stream . I suppose
> that input samples should be 16 bits in opus but samples in AES stream
> can be at most 24 bits. Can opus accepts samples more than 16 bits
> without any modifications in source codes ? If answer is No then "How
> can I modify opus to accept these 24 bits samples ?"

Opus cannot accept 24 bit integer samples directly. Best practice there
is to dither down to 16 bits before encoding.

However, Opus also accepts float samples, so a simpler approach is to
normalize to +/- 1.0 and use opus_encode_float(). That will let you
submit the full precision input data directly to the encoder. Just be
careful with clipping.



More information about the opus mailing list