Class Opus

java.lang.Object
org.lwjgl.util.opus.Opus

public class Opus extends Object
  • Field Details

    • OPUS_OK

      public static final int OPUS_OK
      See Also:
    • OPUS_BAD_ARG

      public static final int OPUS_BAD_ARG
      See Also:
    • OPUS_BUFFER_TOO_SMALL

      public static final int OPUS_BUFFER_TOO_SMALL
      See Also:
    • OPUS_INTERNAL_ERROR

      public static final int OPUS_INTERNAL_ERROR
      See Also:
    • OPUS_INVALID_PACKET

      public static final int OPUS_INVALID_PACKET
      See Also:
    • OPUS_UNIMPLEMENTED

      public static final int OPUS_UNIMPLEMENTED
      See Also:
    • OPUS_INVALID_STATE

      public static final int OPUS_INVALID_STATE
      See Also:
    • OPUS_ALLOC_FAIL

      public static final int OPUS_ALLOC_FAIL
      See Also:
    • OPUS_SET_APPLICATION_REQUEST

      public static final int OPUS_SET_APPLICATION_REQUEST
      See Also:
    • OPUS_GET_APPLICATION_REQUEST

      public static final int OPUS_GET_APPLICATION_REQUEST
      See Also:
    • OPUS_SET_BITRATE_REQUEST

      public static final int OPUS_SET_BITRATE_REQUEST
      See Also:
    • OPUS_GET_BITRATE_REQUEST

      public static final int OPUS_GET_BITRATE_REQUEST
      See Also:
    • OPUS_SET_MAX_BANDWIDTH_REQUEST

      public static final int OPUS_SET_MAX_BANDWIDTH_REQUEST
      See Also:
    • OPUS_GET_MAX_BANDWIDTH_REQUEST

      public static final int OPUS_GET_MAX_BANDWIDTH_REQUEST
      See Also:
    • OPUS_SET_VBR_REQUEST

      public static final int OPUS_SET_VBR_REQUEST
      See Also:
    • OPUS_GET_VBR_REQUEST

      public static final int OPUS_GET_VBR_REQUEST
      See Also:
    • OPUS_SET_BANDWIDTH_REQUEST

      public static final int OPUS_SET_BANDWIDTH_REQUEST
      See Also:
    • OPUS_GET_BANDWIDTH_REQUEST

      public static final int OPUS_GET_BANDWIDTH_REQUEST
      See Also:
    • OPUS_SET_COMPLEXITY_REQUEST

      public static final int OPUS_SET_COMPLEXITY_REQUEST
      See Also:
    • OPUS_GET_COMPLEXITY_REQUEST

      public static final int OPUS_GET_COMPLEXITY_REQUEST
      See Also:
    • OPUS_SET_INBAND_FEC_REQUEST

      public static final int OPUS_SET_INBAND_FEC_REQUEST
      See Also:
    • OPUS_GET_INBAND_FEC_REQUEST

      public static final int OPUS_GET_INBAND_FEC_REQUEST
      See Also:
    • OPUS_SET_PACKET_LOSS_PERC_REQUEST

      public static final int OPUS_SET_PACKET_LOSS_PERC_REQUEST
      See Also:
    • OPUS_GET_PACKET_LOSS_PERC_REQUEST

      public static final int OPUS_GET_PACKET_LOSS_PERC_REQUEST
      See Also:
    • OPUS_SET_DTX_REQUEST

      public static final int OPUS_SET_DTX_REQUEST
      See Also:
    • OPUS_GET_DTX_REQUEST

      public static final int OPUS_GET_DTX_REQUEST
      See Also:
    • OPUS_SET_VBR_CONSTRAINT_REQUEST

      public static final int OPUS_SET_VBR_CONSTRAINT_REQUEST
      See Also:
    • OPUS_GET_VBR_CONSTRAINT_REQUEST

      public static final int OPUS_GET_VBR_CONSTRAINT_REQUEST
      See Also:
    • OPUS_SET_FORCE_CHANNELS_REQUEST

      public static final int OPUS_SET_FORCE_CHANNELS_REQUEST
      See Also:
    • OPUS_GET_FORCE_CHANNELS_REQUEST

      public static final int OPUS_GET_FORCE_CHANNELS_REQUEST
      See Also:
    • OPUS_SET_SIGNAL_REQUEST

      public static final int OPUS_SET_SIGNAL_REQUEST
      See Also:
    • OPUS_GET_SIGNAL_REQUEST

      public static final int OPUS_GET_SIGNAL_REQUEST
      See Also:
    • OPUS_GET_LOOKAHEAD_REQUEST

      public static final int OPUS_GET_LOOKAHEAD_REQUEST
      See Also:
    • OPUS_RESET_STATE

      public static final int OPUS_RESET_STATE
      See Also:
    • OPUS_GET_SAMPLE_RATE_REQUEST

      public static final int OPUS_GET_SAMPLE_RATE_REQUEST
      See Also:
    • OPUS_GET_FINAL_RANGE_REQUEST

      public static final int OPUS_GET_FINAL_RANGE_REQUEST
      See Also:
    • OPUS_GET_PITCH_REQUEST

      public static final int OPUS_GET_PITCH_REQUEST
      See Also:
    • OPUS_SET_GAIN_REQUEST

      public static final int OPUS_SET_GAIN_REQUEST
      See Also:
    • OPUS_GET_GAIN_REQUEST

      public static final int OPUS_GET_GAIN_REQUEST
      See Also:
    • OPUS_SET_LSB_DEPTH_REQUEST

      public static final int OPUS_SET_LSB_DEPTH_REQUEST
      See Also:
    • OPUS_GET_LSB_DEPTH_REQUEST

      public static final int OPUS_GET_LSB_DEPTH_REQUEST
      See Also:
    • OPUS_GET_LAST_PACKET_DURATION_REQUEST

      public static final int OPUS_GET_LAST_PACKET_DURATION_REQUEST
      See Also:
    • OPUS_SET_EXPERT_FRAME_DURATION_REQUEST

      public static final int OPUS_SET_EXPERT_FRAME_DURATION_REQUEST
      See Also:
    • OPUS_GET_EXPERT_FRAME_DURATION_REQUEST

      public static final int OPUS_GET_EXPERT_FRAME_DURATION_REQUEST
      See Also:
    • OPUS_SET_PREDICTION_DISABLED_REQUEST

      public static final int OPUS_SET_PREDICTION_DISABLED_REQUEST
      See Also:
    • OPUS_GET_PREDICTION_DISABLED_REQUEST

      public static final int OPUS_GET_PREDICTION_DISABLED_REQUEST
      See Also:
    • OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST

      public static final int OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
      See Also:
    • OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST

      public static final int OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST
      See Also:
    • OPUS_GET_IN_DTX_REQUEST

      public static final int OPUS_GET_IN_DTX_REQUEST
      See Also:
    • OPUS_SET_DRED_DURATION_REQUEST

      public static final int OPUS_SET_DRED_DURATION_REQUEST
      See Also:
    • OPUS_GET_DRED_DURATION_REQUEST

      public static final int OPUS_GET_DRED_DURATION_REQUEST
      See Also:
    • OPUS_SET_DNN_BLOB_REQUEST

      public static final int OPUS_SET_DNN_BLOB_REQUEST
      See Also:
    • OPUS_AUTO

      public static final int OPUS_AUTO
      See Also:
    • OPUS_BITRATE_MAX

      public static final int OPUS_BITRATE_MAX
      See Also:
    • OPUS_APPLICATION_VOIP

      public static final int OPUS_APPLICATION_VOIP
      See Also:
    • OPUS_APPLICATION_AUDIO

      public static final int OPUS_APPLICATION_AUDIO
      See Also:
    • OPUS_APPLICATION_RESTRICTED_LOWDELAY

      public static final int OPUS_APPLICATION_RESTRICTED_LOWDELAY
      See Also:
    • OPUS_SIGNAL_VOICE

      public static final int OPUS_SIGNAL_VOICE
      See Also:
    • OPUS_SIGNAL_MUSIC

      public static final int OPUS_SIGNAL_MUSIC
      See Also:
    • OPUS_BANDWIDTH_NARROWBAND

      public static final int OPUS_BANDWIDTH_NARROWBAND
      See Also:
    • OPUS_BANDWIDTH_MEDIUMBAND

      public static final int OPUS_BANDWIDTH_MEDIUMBAND
      See Also:
    • OPUS_BANDWIDTH_WIDEBAND

      public static final int OPUS_BANDWIDTH_WIDEBAND
      See Also:
    • OPUS_BANDWIDTH_SUPERWIDEBAND

      public static final int OPUS_BANDWIDTH_SUPERWIDEBAND
      See Also:
    • OPUS_BANDWIDTH_FULLBAND

      public static final int OPUS_BANDWIDTH_FULLBAND
      See Also:
    • OPUS_FRAMESIZE_ARG

      public static final int OPUS_FRAMESIZE_ARG
      See Also:
    • OPUS_FRAMESIZE_2_5_MS

      public static final int OPUS_FRAMESIZE_2_5_MS
      See Also:
    • OPUS_FRAMESIZE_5_MS

      public static final int OPUS_FRAMESIZE_5_MS
      See Also:
    • OPUS_FRAMESIZE_10_MS

      public static final int OPUS_FRAMESIZE_10_MS
      See Also:
    • OPUS_FRAMESIZE_20_MS

      public static final int OPUS_FRAMESIZE_20_MS
      See Also:
    • OPUS_FRAMESIZE_40_MS

      public static final int OPUS_FRAMESIZE_40_MS
      See Also:
    • OPUS_FRAMESIZE_60_MS

      public static final int OPUS_FRAMESIZE_60_MS
      See Also:
    • OPUS_FRAMESIZE_80_MS

      public static final int OPUS_FRAMESIZE_80_MS
      See Also:
    • OPUS_FRAMESIZE_100_MS

      public static final int OPUS_FRAMESIZE_100_MS
      See Also:
    • OPUS_FRAMESIZE_120_MS

      public static final int OPUS_FRAMESIZE_120_MS
      See Also:
  • Method Details

    • getLibrary

      public static SharedLibrary getLibrary()
      Returns the opus SharedLibrary.
    • opus_encoder_get_size

      public static int opus_encoder_get_size(int channels)
      int opus_encoder_get_size(int channels)
    • nopus_encoder_create

      public static long nopus_encoder_create(int Fs, int channels, int application, long error)
      OpusEncoder * opus_encoder_create(opus_int32 Fs, int channels, int application, int * error)
    • opus_encoder_create

      public static long opus_encoder_create(int Fs, int channels, int application, @Nullable IntBuffer error)
      OpusEncoder * opus_encoder_create(opus_int32 Fs, int channels, int application, int * error)
    • opus_encoder_init

      public static int opus_encoder_init(long st, int Fs, int channels, int application)
      int opus_encoder_init(OpusEncoder * st, opus_int32 Fs, int channels, int application)
    • nopus_encode

      public static int nopus_encode(long st, long pcm, int frame_size, long data, int max_data_bytes)
      opus_int32 opus_encode(OpusEncoder * st, opus_int16 const * pcm, int frame_size, unsigned char * data, opus_int32 max_data_bytes)
    • opus_encode

      public static int opus_encode(long st, ShortBuffer pcm, int frame_size, ByteBuffer data)
      opus_int32 opus_encode(OpusEncoder * st, opus_int16 const * pcm, int frame_size, unsigned char * data, opus_int32 max_data_bytes)
    • nopus_encode_float

      public static int nopus_encode_float(long st, long pcm, int frame_size, long data, int max_data_bytes)
      opus_int32 opus_encode_float(OpusEncoder * st, float const * pcm, int frame_size, unsigned char * data, opus_int32 max_data_bytes)
    • opus_encode_float

      public static int opus_encode_float(long st, FloatBuffer pcm, int frame_size, ByteBuffer data)
      opus_int32 opus_encode_float(OpusEncoder * st, float const * pcm, int frame_size, unsigned char * data, opus_int32 max_data_bytes)
    • opus_encoder_destroy

      public static void opus_encoder_destroy(long st)
      void opus_encoder_destroy(OpusEncoder * st)
    • opus_decoder_get_size

      public static int opus_decoder_get_size(int channels)
      int opus_decoder_get_size(int channels)
    • nopus_decoder_create

      public static long nopus_decoder_create(int Fs, int channels, long error)
      OpusDecoder * opus_decoder_create(opus_int32 Fs, int channels, int * error)
    • opus_decoder_create

      public static long opus_decoder_create(int Fs, int channels, @Nullable IntBuffer error)
      OpusDecoder * opus_decoder_create(opus_int32 Fs, int channels, int * error)
    • opus_decoder_init

      public static int opus_decoder_init(long st, int Fs, int channels)
      int opus_decoder_init(OpusDecoder * st, opus_int32 Fs, int channels)
    • nopus_decode

      public static int nopus_decode(long st, long data, int len, long pcm, int frame_size, int decode_fec)
      int opus_decode(OpusDecoder * st, unsigned char const * data, opus_int32 len, opus_int16 * pcm, int frame_size, int decode_fec)
    • opus_decode

      public static int opus_decode(long st, @Nullable ByteBuffer data, ShortBuffer pcm, int frame_size, int decode_fec)
      int opus_decode(OpusDecoder * st, unsigned char const * data, opus_int32 len, opus_int16 * pcm, int frame_size, int decode_fec)
    • nopus_decode_float

      public static int nopus_decode_float(long st, long data, int len, long pcm, int frame_size, int decode_fec)
      int opus_decode_float(OpusDecoder * st, unsigned char const * data, opus_int32 len, float * pcm, int frame_size, int decode_fec)
    • opus_decode_float

      public static int opus_decode_float(long st, @Nullable ByteBuffer data, FloatBuffer pcm, int frame_size, int decode_fec)
      int opus_decode_float(OpusDecoder * st, unsigned char const * data, opus_int32 len, float * pcm, int frame_size, int decode_fec)
    • opus_decoder_destroy

      public static void opus_decoder_destroy(long st)
      void opus_decoder_destroy(OpusDecoder * st)
    • opus_dred_decoder_get_size

      public static int opus_dred_decoder_get_size()
      int opus_dred_decoder_get_size(void)
    • nopus_dred_decoder_create

      public static long nopus_dred_decoder_create(long error)
      OpusDREDDecoder * opus_dred_decoder_create(int * error)
    • opus_dred_decoder_create

      public static long opus_dred_decoder_create(@Nullable IntBuffer error)
      OpusDREDDecoder * opus_dred_decoder_create(int * error)
    • opus_dred_decoder_init

      public static int opus_dred_decoder_init(long dec)
      int opus_dred_decoder_init(OpusDREDDecoder * dec)
    • opus_dred_decoder_destroy

      public static void opus_dred_decoder_destroy(long dec)
      void opus_dred_decoder_destroy(OpusDREDDecoder * dec)
    • opus_dred_get_size

      public static int opus_dred_get_size()
      int opus_dred_get_size(void)
    • nopus_dred_alloc

      public static long nopus_dred_alloc(long error)
      OpusDRED * opus_dred_alloc(int * error)
    • opus_dred_alloc

      public static long opus_dred_alloc(@Nullable IntBuffer error)
      OpusDRED * opus_dred_alloc(int * error)
    • opus_dred_free

      public static void opus_dred_free(long dec)
      void opus_dred_free(OpusDRED * dec)
    • nopus_dred_parse

      public static int nopus_dred_parse(long dred_dec, long dred, long data, int len, int max_dred_samples, int sampling_rate, long dred_end, int defer_processing)
      int opus_dred_parse(OpusDREDDecoder * dred_dec, OpusDRED * dred, unsigned char const * data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int * dred_end, int defer_processing)
    • opus_dred_parse

      public static int opus_dred_parse(long dred_dec, long dred, ByteBuffer data, int max_dred_samples, int sampling_rate, @Nullable IntBuffer dred_end, boolean defer_processing)
      int opus_dred_parse(OpusDREDDecoder * dred_dec, OpusDRED * dred, unsigned char const * data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int * dred_end, int defer_processing)
    • opus_dred_process

      public static int opus_dred_process(long dred_dec, long src, long dst)
      int opus_dred_process(OpusDREDDecoder * dred_dec, OpusDRED const * src, OpusDRED * dst)
    • nopus_decoder_dred_decode

      public static int nopus_decoder_dred_decode(long st, long dred, int dred_offset, long pcm, int frame_size)
      int opus_decoder_dred_decode(OpusDecoder * st, OpusDRED const * dred, opus_int32 dred_offset, opus_int16 * pcm, int frame_size)
    • opus_decoder_dred_decode

      public static int opus_decoder_dred_decode(long st, long dred, int dred_offset, ShortBuffer pcm, int frame_size)
      int opus_decoder_dred_decode(OpusDecoder * st, OpusDRED const * dred, opus_int32 dred_offset, opus_int16 * pcm, int frame_size)
    • nopus_decoder_dred_decode_float

      public static int nopus_decoder_dred_decode_float(long st, long dred, int dred_offset, long pcm, int frame_size)
      int opus_decoder_dred_decode_float(OpusDecoder * st, OpusDRED const * dred, opus_int32 dred_offset, float * pcm, int frame_size)
    • opus_decoder_dred_decode_float

      public static int opus_decoder_dred_decode_float(long st, long dred, int dred_offset, FloatBuffer pcm, int frame_size)
      int opus_decoder_dred_decode_float(OpusDecoder * st, OpusDRED const * dred, opus_int32 dred_offset, float * pcm, int frame_size)
    • nopus_packet_parse

      public static int nopus_packet_parse(long data, int len, long out_toc, long frames, long size, long payload_offset)
      int opus_packet_parse(unsigned char const * data, opus_int32 len, unsigned char * out_toc, unsigned char const ** frames, opus_int16 * size, int * payload_offset)
    • opus_packet_parse

      public static int opus_packet_parse(ByteBuffer data, @Nullable ByteBuffer out_toc, @Nullable PointerBuffer frames, ShortBuffer size, @Nullable IntBuffer payload_offset)
      int opus_packet_parse(unsigned char const * data, opus_int32 len, unsigned char * out_toc, unsigned char const ** frames, opus_int16 * size, int * payload_offset)
    • nopus_packet_get_bandwidth

      public static int nopus_packet_get_bandwidth(long data)
      int opus_packet_get_bandwidth(unsigned char const * data)
    • opus_packet_get_bandwidth

      public static int opus_packet_get_bandwidth(ByteBuffer data)
      int opus_packet_get_bandwidth(unsigned char const * data)
    • nopus_packet_get_samples_per_frame

      public static int nopus_packet_get_samples_per_frame(long data, int Fs)
      int opus_packet_get_samples_per_frame(unsigned char const * data, opus_int32 Fs)
    • opus_packet_get_samples_per_frame

      public static int opus_packet_get_samples_per_frame(ByteBuffer data, int Fs)
      int opus_packet_get_samples_per_frame(unsigned char const * data, opus_int32 Fs)
    • nopus_packet_get_nb_channels

      public static int nopus_packet_get_nb_channels(long data)
      int opus_packet_get_nb_channels(unsigned char const * data)
    • opus_packet_get_nb_channels

      public static int opus_packet_get_nb_channels(ByteBuffer data)
      int opus_packet_get_nb_channels(unsigned char const * data)
    • nopus_packet_get_nb_frames

      public static int nopus_packet_get_nb_frames(long packet, int len)
      int opus_packet_get_nb_frames(unsigned char const * packet, opus_int32 len)
    • opus_packet_get_nb_frames

      public static int opus_packet_get_nb_frames(ByteBuffer packet)
      int opus_packet_get_nb_frames(unsigned char const * packet, opus_int32 len)
    • nopus_packet_get_nb_samples

      public static int nopus_packet_get_nb_samples(long packet, int len, int Fs)
      int opus_packet_get_nb_samples(unsigned char const * packet, opus_int32 len, opus_int32 Fs)
    • opus_packet_get_nb_samples

      public static int opus_packet_get_nb_samples(ByteBuffer packet, int Fs)
      int opus_packet_get_nb_samples(unsigned char const * packet, opus_int32 len, opus_int32 Fs)
    • nopus_packet_has_lbrr

      public static int nopus_packet_has_lbrr(long packet, int len)
      int opus_packet_has_lbrr(unsigned char const * packet, opus_int32 len)
    • opus_packet_has_lbrr

      public static int opus_packet_has_lbrr(ByteBuffer packet)
      int opus_packet_has_lbrr(unsigned char const * packet, opus_int32 len)
    • nopus_decoder_get_nb_samples

      public static int nopus_decoder_get_nb_samples(long dec, long packet, int len)
      int opus_decoder_get_nb_samples(OpusDecoder const * dec, unsigned char const * packet, opus_int32 len)
    • opus_decoder_get_nb_samples

      public static int opus_decoder_get_nb_samples(long dec, ByteBuffer packet)
      int opus_decoder_get_nb_samples(OpusDecoder const * dec, unsigned char const * packet, opus_int32 len)
    • nopus_pcm_soft_clip

      public static void nopus_pcm_soft_clip(long pcm, int frame_size, int channels, long softclip_mem)
      void opus_pcm_soft_clip(float * pcm, int frame_size, int channels, float * softclip_mem)
    • opus_pcm_soft_clip

      public static void opus_pcm_soft_clip(FloatBuffer pcm, int frame_size, FloatBuffer softclip_mem)
      void opus_pcm_soft_clip(float * pcm, int frame_size, int channels, float * softclip_mem)
    • opus_repacketizer_get_size

      public static int opus_repacketizer_get_size()
      int opus_repacketizer_get_size(void)
    • opus_repacketizer_init

      public static long opus_repacketizer_init(long rp)
      OpusRepacketizer * opus_repacketizer_init(OpusRepacketizer * rp)
    • opus_repacketizer_create

      public static long opus_repacketizer_create()
      OpusRepacketizer * opus_repacketizer_create(void)
    • opus_repacketizer_destroy

      public static void opus_repacketizer_destroy(long rp)
      void opus_repacketizer_destroy(OpusRepacketizer * rp)
    • nopus_repacketizer_cat

      public static int nopus_repacketizer_cat(long rp, long data, int len)
      int opus_repacketizer_cat(OpusRepacketizer * rp, unsigned char const * data, opus_int32 len)
    • opus_repacketizer_cat

      public static int opus_repacketizer_cat(long rp, ByteBuffer data)
      int opus_repacketizer_cat(OpusRepacketizer * rp, unsigned char const * data, opus_int32 len)
    • nopus_repacketizer_out_range

      public static int nopus_repacketizer_out_range(long rp, int begin, int end, long data, int maxlen)
      opus_int32 opus_repacketizer_out_range(OpusRepacketizer * rp, int begin, int end, unsigned char const * data, opus_int32 maxlen)
    • opus_repacketizer_out_range

      public static int opus_repacketizer_out_range(long rp, int begin, int end, ByteBuffer data)
      opus_int32 opus_repacketizer_out_range(OpusRepacketizer * rp, int begin, int end, unsigned char const * data, opus_int32 maxlen)
    • opus_repacketizer_get_nb_frames

      public static int opus_repacketizer_get_nb_frames(long rp)
      int opus_repacketizer_get_nb_frames(OpusRepacketizer * rp)
    • nopus_repacketizer_out

      public static int nopus_repacketizer_out(long rp, long data, int maxlen)
      opus_int32 opus_repacketizer_out(OpusRepacketizer * rp, unsigned char const * data, opus_int32 maxlen)
    • opus_repacketizer_out

      public static int opus_repacketizer_out(long rp, ByteBuffer data)
      opus_int32 opus_repacketizer_out(OpusRepacketizer * rp, unsigned char const * data, opus_int32 maxlen)
    • nopus_packet_pad

      public static int nopus_packet_pad(long data, int len, int new_len)
      int opus_packet_pad(unsigned char const * data, opus_int32 len, opus_int32 new_len)
    • opus_packet_pad

      public static int opus_packet_pad(ByteBuffer data, int len, int new_len)
      int opus_packet_pad(unsigned char const * data, opus_int32 len, opus_int32 new_len)
    • nopus_packet_unpad

      public static int nopus_packet_unpad(long data, int len)
      opus_int32 opus_packet_unpad(unsigned char const * data, opus_int32 len)
    • opus_packet_unpad

      public static int opus_packet_unpad(ByteBuffer data, int len)
      opus_int32 opus_packet_unpad(unsigned char const * data, opus_int32 len)
    • nopus_multistream_packet_pad

      public static int nopus_multistream_packet_pad(long data, int len, int new_len, int nb_streams)
      int opus_multistream_packet_pad(unsigned char const * data, opus_int32 len, opus_int32 new_len, int nb_streams)
    • opus_multistream_packet_pad

      public static int opus_multistream_packet_pad(ByteBuffer data, int len, int new_len, int nb_streams)
      int opus_multistream_packet_pad(unsigned char const * data, opus_int32 len, opus_int32 new_len, int nb_streams)
    • nopus_multistream_packet_unpad

      public static int nopus_multistream_packet_unpad(long data, int len, int nb_streams)
      opus_int32 opus_multistream_packet_unpad(unsigned char const * data, opus_int32 len, int nb_streams)
    • opus_multistream_packet_unpad

      public static int opus_multistream_packet_unpad(ByteBuffer data, int len, int nb_streams)
      opus_int32 opus_multistream_packet_unpad(unsigned char const * data, opus_int32 len, int nb_streams)
    • nopus_strerror

      public static long nopus_strerror(int error)
      char * opus_strerror(int error)
    • opus_strerror

      public static @Nullable String opus_strerror(int error)
      char * opus_strerror(int error)
    • nopus_get_version_string

      public static long nopus_get_version_string()
      char * opus_get_version_string(void)
    • opus_get_version_string

      public static @Nullable String opus_get_version_string()
      char * opus_get_version_string(void)
    • opus_encoder_ctl

      public static int opus_encoder_ctl(long st, int request)
      Performs a CTL function on an Opus encoder.
      Parameters:
      st - encoder state
      request - CTL request
    • opus_encoder_ctl

      public static int opus_encoder_ctl(long st, Opus.CTLRequest request)
      Performs a CTL function on an Opus encoder.
      Parameters:
      st - encoder state
      request - CTL request
    • opus_decoder_ctl

      public static int opus_decoder_ctl(long st, int request)
      Performs a CTL function on an Opus decoder.
      Parameters:
      st - decoder state
      request - CTL request
    • opus_decoder_ctl

      public static int opus_decoder_ctl(long st, Opus.CTLRequest request)
      Performs a CTL function on an Opus decoder.
      Parameters:
      st - decoder state
      request - CTL request
    • opus_dred_decoder_ctl

      public static int opus_dred_decoder_ctl(long dred_dec, int request)
      Performs a CTL function on an Opus DRED decoder.
      Parameters:
      dred_dec - decoder state
      request - CTL request
    • opus_dred_decoder_ctl

      public static int opus_dred_decoder_ctl(long dred_dec, Opus.CTLRequest request)
      Performs a CTL function on an Opus DRED decoder.
      Parameters:
      dred_dec - decoder state
      request - CTL request
    • OPUS_SET_COMPLEXITY

      public static Opus.CTLRequest OPUS_SET_COMPLEXITY(int value)
      Configures the encoder's computational complexity.

      The supported range is 0-10 inclusive with 10 representing the highest complexity.

      Parameters:
      value - 0-10, inclusive
    • OPUS_GET_COMPLEXITY

      public static Opus.CTLRequest OPUS_GET_COMPLEXITY(IntBuffer value)
      Gets the encoder's complexity configuration.
      Returns:
      a value in the range 0-10, inclusive
    • OPUS_SET_BITRATE

      public static Opus.CTLRequest OPUS_SET_BITRATE(int value)
      Configures the bitrate in the encoder.

      Rates from 500 to 512000 bits per second are meaningful, as well as the special values OPUS_AUTO and OPUS_BITRATE_MAX. The value OPUS_BITRATE_MAX can be used to cause the codec to use as much rate as it can, which is useful for controlling the rate by adjusting the output buffer size.

      Parameters:
      value - bitrate in bits per second. The default is determined based on the number of channels and the input sampling rate.
    • OPUS_GET_BITRATE

      public static Opus.CTLRequest OPUS_GET_BITRATE(IntBuffer value)
      Gets the encoder's bitrate configuration.
      Returns:
      the bitrate in bits per second. The default is determined based on the number of channels and the input sampling rate.
    • OPUS_SET_VBR

      public static Opus.CTLRequest OPUS_SET_VBR(int value)
      Enables or disables variable bitrate (VBR) in the encoder.

      The configured bitrate may not be met exactly because frames must be an integer number of bytes in length.

      Parameters:
      value - allowed values:
      0
      Hard CBR. For LPC/hybrid modes at very low bit-rate, this can cause noticeable quality degradation.
      1
      VBR (default). The exact type of VBR is controlled by #OPUS_SET_VBR_CONSTRAINT.
    • OPUS_GET_VBR

      public static Opus.CTLRequest OPUS_GET_VBR(IntBuffer value)
      Determines if variable bitrate (VBR) is enabled in the encoder.
      Returns:
      one of the following values:
      0
      Hard CBR.
      1
      VBR (default). The exact type of VBR may be retrieved via OPUS_GET_VBR_CONSTRAINT(java.nio.IntBuffer).
    • OPUS_SET_VBR_CONSTRAINT

      public static Opus.CTLRequest OPUS_SET_VBR_CONSTRAINT(int value)
      Enables or disables constrained VBR in the encoder.

      This setting is ignored when the encoder is in CBR mode. Warning: Only the MDCT mode of Opus currently heeds the constraint. Speech mode ignores it completely, hybrid mode may fail to obey it if the LPC layer uses more bitrate than the constraint would have permitted.

      Parameters:
      value - allowed values:
      0
      Unconstrained VBR.
      1
      Constrained VBR (default). This creates a maximum of one frame of buffering delay assuming a transport with a serialization speed of the nominal bitrate.
    • OPUS_GET_VBR_CONSTRAINT

      public static Opus.CTLRequest OPUS_GET_VBR_CONSTRAINT(IntBuffer value)
      Determines if constrained VBR is enabled in the encoder.
      Returns:
      one of the following values:
      0
      Unconstrained VBR.
      1
      Constrained VBR (default).
    • OPUS_SET_FORCE_CHANNELS

      public static Opus.CTLRequest OPUS_SET_FORCE_CHANNELS(int value)
      Configures mono/stereo forcing in the encoder.

      This can force the encoder to produce packets encoded as either mono or stereo, regardless of the format of the input audio. This is useful when the caller knows that the input signal is currently a mono source embedded in a stereo stream.

      Parameters:
      value - allowed values:
      OPUS_AUTO
      Not forced (default)
      1
      Forced mono
      2
      Forced stereo
    • OPUS_GET_FORCE_CHANNELS

      public static Opus.CTLRequest OPUS_GET_FORCE_CHANNELS(IntBuffer value)
      Gets the encoder's forced channel configuration.
      Returns:
      one of the following values:
      OPUS_AUTO
      Not forced (default)
      1
      Forced mono
      2
      Forced stereo
    • OPUS_SET_MAX_BANDWIDTH

      public static Opus.CTLRequest OPUS_SET_MAX_BANDWIDTH(int value)
      Configures the maximum bandpass that the encoder will select automatically.

      Applications should normally use this instead of OPUS_SET_BANDWIDTH(int) (leaving that set to the default, OPUS_AUTO). This allows the application to set an upper bound based on the type of input it is providing, but still gives the encoder the freedom to reduce the bandpass when the bitrate becomes too low, for better overall quality.

      Parameters:
      value - allowed values:
      OPUS_BANDWIDTH_NARROWBAND
      4 kHz passband
      OPUS_BANDWIDTH_MEDIUMBAND
      6 kHz passband
      OPUS_BANDWIDTH_WIDEBAND
      8 kHz passband
      OPUS_BANDWIDTH_SUPERWIDEBAND
      12 kHz passband
      OPUS_BANDWIDTH_FULLBAND
      20 kHz passband (default)
    • OPUS_GET_MAX_BANDWIDTH

      public static Opus.CTLRequest OPUS_GET_MAX_BANDWIDTH(IntBuffer value)
      Gets the encoder's configured maximum allowed bandpass.
      Returns:
      one of the following values:
      OPUS_BANDWIDTH_NARROWBAND
      4 kHz passband
      OPUS_BANDWIDTH_MEDIUMBAND
      6 kHz passband
      OPUS_BANDWIDTH_WIDEBAND
      8 kHz passband
      OPUS_BANDWIDTH_SUPERWIDEBAND
      12 kHz passband
      OPUS_BANDWIDTH_FULLBAND
      20 kHz passband (default)
    • OPUS_SET_BANDWIDTH

      public static Opus.CTLRequest OPUS_SET_BANDWIDTH(int value)
      Sets the encoder's bandpass to a specific value.

      This prevents the encoder from automatically selecting the bandpass based on the available bitrate. If an application knows the bandpass of the input audio it is providing, it should normally use OPUS_SET_MAX_BANDWIDTH(int) instead, which still gives the encoder the freedom to reduce the bandpass when the bitrate becomes too low, for better overall quality.

      Parameters:
      value - allowed values:
      OPUS_AUTO
      (default)
      OPUS_BANDWIDTH_NARROWBAND
      4 kHz passband
      OPUS_BANDWIDTH_MEDIUMBAND
      6 kHz passband
      OPUS_BANDWIDTH_WIDEBAND
      8 kHz passband
      OPUS_BANDWIDTH_SUPERWIDEBAND
      12 kHz passband
      OPUS_BANDWIDTH_FULLBAND
      20 kHz passband (default)
    • OPUS_GET_BANDWIDTH

      public static Opus.CTLRequest OPUS_GET_BANDWIDTH(IntBuffer value)
      Gets the encoder's configured bandpass or the decoder's last bandpass.
      Returns:
      one of the following values:
      OPUS_AUTO
      (default)
      OPUS_BANDWIDTH_NARROWBAND
      4 kHz passband
      OPUS_BANDWIDTH_MEDIUMBAND
      6 kHz passband
      OPUS_BANDWIDTH_WIDEBAND
      8 kHz passband
      OPUS_BANDWIDTH_SUPERWIDEBAND
      12 kHz passband
      OPUS_BANDWIDTH_FULLBAND
      20 kHz passband (default)
    • OPUS_SET_SIGNAL

      public static Opus.CTLRequest OPUS_SET_SIGNAL(int value)
      Configures the type of signal being encoded.

      This is a hint which helps the encoder's mode selection.

      Parameters:
      value - allowed values:
      OPUS_AUTO
      (default)
      OPUS_SIGNAL_VOICE
      Bias thresholds towards choosing LPC or Hybrid modes.
      OPUS_SIGNAL_MUSIC
      Bias thresholds towards choosing MDCT modes.
    • OPUS_GET_SIGNAL

      public static Opus.CTLRequest OPUS_GET_SIGNAL(IntBuffer value)
      Gets the encoder's configured signal type.
      Returns:
      one of the following values:
      OPUS_AUTO
      (default)
      OPUS_SIGNAL_VOICE
      Bias thresholds towards choosing LPC or Hybrid modes.
      OPUS_SIGNAL_MUSIC
      Bias thresholds towards choosing MDCT modes.
    • OPUS_SET_APPLICATION

      public static Opus.CTLRequest OPUS_SET_APPLICATION(int value)
      Configures the encoder's intended application.

      The initial value is a mandatory argument to the encoder_create function.

      Parameters:
      value - allowed values:
      OPUS_APPLICATION_VOIP
      Process signal for improved speech intelligibility.
      OPUS_APPLICATION_AUDIO
      Favor faithfulness to the original input.
      OPUS_APPLICATION_RESTRICTED_LOWDELAY
      Configure the minimum possible coding delay by disabling certain modes of operation.
    • OPUS_GET_APPLICATION

      public static Opus.CTLRequest OPUS_GET_APPLICATION(IntBuffer value)
      Gets the encoder's configured application.
      Returns:
      one of the following values:
      OPUS_APPLICATION_VOIP
      Process signal for improved speech intelligibility.
      OPUS_APPLICATION_AUDIO
      Favor faithfulness to the original input.
      OPUS_APPLICATION_RESTRICTED_LOWDELAY
      Configure the minimum possible coding delay by disabling certain modes of operation.
    • OPUS_GET_LOOKAHEAD

      public static Opus.CTLRequest OPUS_GET_LOOKAHEAD(IntBuffer value)
      Gets the total samples of delay added by the entire codec.

      This can be queried by the encoder and then the provided number of samples can be skipped on from the start of the decoder's output to provide time aligned input and output. From the perspective of a decoding application the real data begins this many samples late.

      The decoder contribution to this delay is identical for all decoders, but the encoder portion of the delay may vary from implementation to implementation, version to version, or even depend on the encoder's initial configuration. Applications needing delay compensation should call this CTL rather than hard-coding a value.

      Returns:
      number of lookahead samples
    • OPUS_SET_INBAND_FEC

      public static Opus.CTLRequest OPUS_SET_INBAND_FEC(int value)
      Configures the encoder's use of inband forward error correction (FEC).

      Note: This is only applicable to the LPC layer

      Parameters:
      value - allowed values:
      0
      Disable inband FEC (default).
      1
      Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.
      2
      Inband FEC enabled, but does not necessarily switch to SILK if we have music.
    • OPUS_GET_INBAND_FEC

      public static Opus.CTLRequest OPUS_GET_INBAND_FEC(IntBuffer value)
      Gets encoder's configured use of inband forward error correction.
      Returns:
      one of the following values:
      0
      Inband FEC disabled (default).
      1
      Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.
      2
      Inband FEC enabled, but does not necessarily switch to SILK if we have music.
    • OPUS_SET_PACKET_LOSS_PERC

      public static Opus.CTLRequest OPUS_SET_PACKET_LOSS_PERC(int value)
      Configures the encoder's expected packet loss percentage.

      Higher values trigger progressively more loss resistant behavior in the encoder at the expense of quality at a given bitrate in the absence of packet loss, but greater quality under loss.

      Parameters:
      value - loss percentage in the range 0-100, inclusive (default: 0)
    • OPUS_GET_PACKET_LOSS_PERC

      public static Opus.CTLRequest OPUS_GET_PACKET_LOSS_PERC(IntBuffer value)
      Gets the encoder's configured packet loss percentage.
      Returns:
      the configured loss percentage in the range 0-100, inclusive (default: 0)
    • OPUS_SET_DTX

      public static Opus.CTLRequest OPUS_SET_DTX(int value)
      Configures the encoder's use of discontinuous transmission (DTX).

      Note: This is only applicable to the LPC layer

      Parameters:
      value - allowed valued:
      0
      Disable DTX (default).
      1
      Enabled DTX.
    • OPUS_GET_DTX

      public static Opus.CTLRequest OPUS_GET_DTX(IntBuffer value)
      Gets encoder's configured use of discontinuous transmission.
      Returns:
      one of the following values:
      0
      DTX disabled (default).
      1
      DTX enabled.
    • OPUS_SET_LSB_DEPTH

      public static Opus.CTLRequest OPUS_SET_LSB_DEPTH(int value)
      Configures the depth of signal being encoded.

      This is a hint which helps the encoder identify silence and near-silence. It represents the number of significant bits of linear intensity below which the signal contains ignorable quantization or other noise.

      For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate for 16-bit linear pcm input with opus_encode_float().

      When using opus_encode(long, java.nio.ShortBuffer, int, java.nio.ByteBuffer) instead of opus_encode_float(long, java.nio.FloatBuffer, int, java.nio.ByteBuffer), or when libopus is compiled for fixed-point, the encoder uses the minimum of the value set here and the value 16.

      Parameters:
      value - input precision in bits, between 8 and 24 (default: 24).
    • OPUS_GET_LSB_DEPTH

      public static Opus.CTLRequest OPUS_GET_LSB_DEPTH(IntBuffer value)
      Gets the encoder's configured signal depth.
      Returns:
      input precision in bits, between 8 and 24 (default: 24).
    • OPUS_SET_EXPERT_FRAME_DURATION

      public static Opus.CTLRequest OPUS_SET_EXPERT_FRAME_DURATION(int value)
      Configures the encoder's use of variable duration frames.

      When variable duration is enabled, the encoder is free to use a shorter frame size than the one requested in the opus_encode*() call. It is then the user's responsibility to verify how much audio was encoded by checking the ToC byte of the encoded packet. The part of the audio that was not encoded needs to be resent to the encoder for the next call. Do not use this option unless you really know what you are doing.

      Parameters:
      value - allowed valued:
      OPUS_FRAMESIZE_ARG
      Select frame size from the argument (default).
      OPUS_FRAMESIZE_2_5_MS
      Use 2.5 ms frames.
      OPUS_FRAMESIZE_5_MS
      Use 5 ms frames.
      OPUS_FRAMESIZE_10_MS
      Use 10 ms frames.
      OPUS_FRAMESIZE_20_MS
      Use 20 ms frames.
      OPUS_FRAMESIZE_40_MS
      Use 40 ms frames.
      OPUS_FRAMESIZE_60_MS
      Use 60 ms frames.
      OPUS_FRAMESIZE_80_MS
      Use 80 ms frames.
      OPUS_FRAMESIZE_100_MS
      Use 100 ms frames.
      OPUS_FRAMESIZE_120_MS
      Use 120 ms frames.
    • OPUS_GET_EXPERT_FRAME_DURATION

      public static Opus.CTLRequest OPUS_GET_EXPERT_FRAME_DURATION(IntBuffer value)
      Gets the encoder's configured use of variable duration frames.
      Returns:
      one of the following values:
      OPUS_FRAMESIZE_ARG
      Select frame size from the argument (default).
      OPUS_FRAMESIZE_2_5_MS
      Use 2.5 ms frames.
      OPUS_FRAMESIZE_5_MS
      Use 5 ms frames.
      OPUS_FRAMESIZE_10_MS
      Use 10 ms frames.
      OPUS_FRAMESIZE_20_MS
      Use 20 ms frames.
      OPUS_FRAMESIZE_40_MS
      Use 40 ms frames.
      OPUS_FRAMESIZE_60_MS
      Use 60 ms frames.
      OPUS_FRAMESIZE_80_MS
      Use 80 ms frames.
      OPUS_FRAMESIZE_100_MS
      Use 100 ms frames.
      OPUS_FRAMESIZE_120_MS
      Use 120 ms frames.
    • OPUS_SET_PREDICTION_DISABLED

      public static Opus.CTLRequest OPUS_SET_PREDICTION_DISABLED(int value)
      If set to 1, disables almost all use of prediction, making frames almost completely independent. This reduces quality.
      Parameters:
      value - allowed valued:
      0
      Enable prediction (default).
      1
      Disable prediction.
    • OPUS_GET_PREDICTION_DISABLED

      public static Opus.CTLRequest OPUS_GET_PREDICTION_DISABLED(IntBuffer value)
      Gets the encoder's configured prediction status.
      Returns:
      one of the following values:
      0
      Prediction enabled (default).
      1
      Prediction disabled.
    • OPUS_SET_DRED_DURATION_REQUEST

      public static Opus.CTLRequest OPUS_SET_DRED_DURATION_REQUEST(int value)
      If non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of 10-ms redundant frames.
    • OPUS_GET_DRED_DURATION_REQUEST

      public static Opus.CTLRequest OPUS_GET_DRED_DURATION_REQUEST(IntBuffer value)
      Gets the encoder's configured Deep Redundancy (DRED) maximum number of frames.
    • OPUS_SET_DNN_BLOB_REQUEST

      public static Opus.CTLRequest OPUS_SET_DNN_BLOB_REQUEST(ByteBuffer data, int len)
      Provide external DNN weights from binary object (only when explicitly built without the weights).
    • OPUS_GET_FINAL_RANGE

      public static Opus.CTLRequest OPUS_GET_FINAL_RANGE(IntBuffer value)
      Gets the final state of the codec's entropy coder.

      This is used for testing purposes. The encoder and decoder state should be identical after coding a payload (assuming no data corruption or software bugs).

      Returns:
      entropy coder state
    • OPUS_GET_SAMPLE_RATE

      public static Opus.CTLRequest OPUS_GET_SAMPLE_RATE(IntBuffer value)
      Gets the sampling rate the encoder or decoder was initialized with.

      This simply returns the Fs value passed to opus_encoder_init(long, int, int, int) or opus_decoder_init(long, int, int).

      Returns:
      sampling rate of encoder or decoder.
    • OPUS_SET_PHASE_INVERSION_DISABLED

      public static Opus.CTLRequest OPUS_SET_PHASE_INVERSION_DISABLED(int value)
      If set to 1, disables the use of phase inversion for intensity stereo, improving the quality of mono downmixes, but slightly reducing normal stereo quality.

      Disabling phase inversion in the decoder does not comply with RFC 6716, although it does not cause any interoperability issue and is expected to become part of the Opus standard once RFC 6716 is updated by draft-ietf-codec-opus-update.

      Parameters:
      value - allowed valued:
      0
      Enable phase inversion (default).
      1
      Disable phase inversion.
    • OPUS_GET_PHASE_INVERSION_DISABLED

      public static Opus.CTLRequest OPUS_GET_PHASE_INVERSION_DISABLED(IntBuffer value)
      Gets the encoder's configured phase inversion status.
      Returns:
      one of the following values:
      0
      Stereo phase inversion enabled (default).
      1
      Stereo phase inversion disabled.
    • OPUS_GET_IN_DTX

      public static Opus.CTLRequest OPUS_GET_IN_DTX(IntBuffer value)
      Gets the DTX state of the encoder.

      Returns whether the last encoded frame was either a comfort noise update during DTX or not encoded because of DTX.

      Returns:
      one of the following values:
      0
      The encoder is not in DTX.
      1
      The encoder is in DTX.
    • OPUS_SET_GAIN

      public static Opus.CTLRequest OPUS_SET_GAIN(int value)
      Configures decoder gain adjustment.

      Scales the decoded output by a factor specified in Q8 dB units. This has a maximum range of -32768 to 32767 inclusive, and returns OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment. This setting survives decoder reset.

      gain = pow(10, x/(20.0*256))

      Parameters:
      value - amount to scale PCM signal by in Q8 dB units.
    • OPUS_GET_GAIN

      public static Opus.CTLRequest OPUS_GET_GAIN(IntBuffer value)
      Gets the decoder's configured gain adjustment.
      Returns:
      amount to scale PCM signal by in Q8 dB units.
    • OPUS_GET_LAST_PACKET_DURATION

      public static Opus.CTLRequest OPUS_GET_LAST_PACKET_DURATION(IntBuffer value)
      Gets the duration (in samples) of the last packet successfully decoded or concealed.
      Returns:
      number of samples (at current sampling rate).
    • OPUS_GET_PITCH

      public static Opus.CTLRequest OPUS_GET_PITCH(IntBuffer value)
      Gets the pitch of the last decoded frame, if available.

      This can be used for any post-processing algorithm requiring the use of pitch, e.g. time stretching/shortening. If the last frame was not voiced, or if the pitch was not coded in the frame, then zero is returned.

      This CTL is only implemented for decoder instances.

      Returns:
      pitch period at 48 kHz (or 0 if not available)