The libopusenc package provides a convenient high-level API for encoding Ogg Opus files.
The main API is divided into several sections:
Many of the functions in this library return a negative error code when a function fails.
| Modifier and Type | Class and Description |
|---|---|
| public static class | OpusEnc.
Contains the function pointers loaded from |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | OPE_ALLOC_FAIL
Error codes. |
| public static final int | OPE_API_VERSION
API version for this header. |
| public static final int | OPE_BAD_ARG
Error codes. |
| public static final int | OPE_CANNOT_OPEN
Error codes. |
| public static final int | OPE_CLOSE_FAIL
Error codes. |
| public static final int | OPE_GET_COMMENT_PADDING_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_DECISION_DELAY_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_HEADER_GAIN_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_MUXING_DELAY_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_NB_COUPLED_STREAMS_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_NB_STREAMS_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_GET_SERIALNO_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_INTERNAL_ERROR
Error codes. |
| public static final int | OPE_INVALID_ICON
Error codes. |
| public static final int | OPE_INVALID_PICTURE
Error codes. |
| public static final int | OPE_OK
Error codes. |
| public static final int | OPE_SET_COMMENT_PADDING_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_SET_DECISION_DELAY_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_SET_HEADER_GAIN_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_SET_MUXING_DELAY_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_SET_PACKET_CALLBACK_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_SET_SERIALNO_REQUEST
"Raw" request values -- they should usually not be used. |
| public static final int | OPE_TOO_LATE
Error codes. |
| public static final int | OPE_UNIMPLEMENTED
Error codes. |
| public static final int | OPE_WRITE_FAIL
Error codes. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static int | |
| public static int | nope_comments_add_picture(long comments, long filename, int picture_type, long description)
Unsafe version of: |
| public static int | nope_comments_add_picture_from_memory(long comments, long ptr, long
size of picture pointed to by size, int picture_type, long description)ptrUnsafe version of: |
| public static int | |
| public static int | nope_encoder_continue_new_file(long enc, long path, long comments)
Unsafe version of: |
| public static long | nope_encoder_create_callbacks(long callbacks, long user_data, long comments, int rate, int channels, int family, long error)
Unsafe version of: |
| public static long | nope_encoder_create_file(long path, long comments, int rate, int channels, int family, long error)
Unsafe version of: |
| public static long | nope_encoder_create_pull(long comments, int rate, int channels, int family, long error)
Unsafe version of: |
| public static int | nope_encoder_deferred_init_with_mapping(long enc, int family, int streams, int coupled_streams, long mapping)
Unsafe version of: |
| public static int | |
| public static int | |
| public static int | nope_encoder_write_float(long enc, long pcm, int samples_per_channel)
Unsafe version of: |
| public static long | |
| public static long | |
| public static int | Returns: error codewhere to add the comments comments, ByteBuffer tag for the comment (must not contain tag, ByteBuffer = char)value for the tag val)Add a comment. |
| public static int | Returns: error codewhere to add the comments comments, CharSequence tag for the comment (must not contain tag, CharSequence = char)value for the tag val)Add a comment. |
| public static int | Returns: error codewhere to add the comments comments, ByteBuffer file name for the picture filename, int type of picture ( picture_type, ByteBuffer -1 for default)description ( description)NULL means no comment)Add a picture from a file. |
| public static int | Returns: error codewhere to add the comments comments, CharSequence file name for the picture filename, int type of picture ( picture_type, CharSequence -1 for default)description ( description)NULL means no comment)Add a picture from a file. |
| public static int | Returns: error codewhere to add the comments comments, ByteBuffer pointer to picture in memory ptr, int type of picture ( picture_type, ByteBuffer -1 for default)description ( description)NULL means no comment)Add a picture already in memory. |
| public static int | Returns: error codewhere to add the comments comments, ByteBuffer pointer to picture in memory ptr, int type of picture ( picture_type, CharSequence -1 for default)description ( description)NULL means no comment)Add a picture already in memory. |
| public static int | Returns: error codewhere to add the comments comments, ByteBuffer string of the form tag_and_val)tag=value (must contain = char)Add a comment as a single tag=value string. |
| public static int | Returns: error codewhere to add the comments comments, CharSequence string of the form tag_and_val)tag=value (must contain = char)Add a comment as a single tag=value string. |
| public static long | Returns: deep copy of inputcomments object to copy comments)Create a deep copy of a comments object. |
| public static long | |
| public static void | |
| public static int | Returns: error codeencoder enc, long comments associated with the stream comments)Ends the stream and create a new stream within the same file. |
| public static int | Returns: error codeencoder enc, long pointer to be associated with the new stream and passed to the callbacks user_data, long comments associated with the stream comments)Ends the stream and create a new file (callback-based). |
| public static int | Returns: error codeencoder enc, ByteBuffer path where to write the new file path, long comments associated with the stream comments)Ends the stream and create a new file. |
| public static int | Returns: error codeencoder enc, CharSequence path where to write the new file path, long comments associated with the stream comments)Ends the stream and create a new file. |
| public static long | Returns: newly-created encodercallback functions callbacks, long pointer to be associated with the stream and passed to the callbacks user_data, long comments associated with the stream comments, int input sampling rate (48 kHz is faster) rate, int number of channels channels, int mapping family ( family, IntBuffer 0 for mono/stereo, 1 for surround)error code ( error)NULL if no error is to be returned)Create a new OggOpus stream to be handled using callbacks |
| public static long | Returns: newly-created encoderpath where to create the file path, long comments associated with the stream comments, int input sampling rate (48 kHz is faster) rate, int number of channels channels, int mapping family (0 for mono/stereo, 1 for surround) family, IntBuffer error code ( error)NULL if no error is to be returned)Create a new OggOpus file. |
| public static long | Returns: newly-created encoderpath where to create the file path, long comments associated with the stream comments, int input sampling rate (48 kHz is faster) rate, int number of channels channels, int mapping family (0 for mono/stereo, 1 for surround) family, IntBuffer error code ( error)NULL if no error is to be returned)Create a new OggOpus file. |
| public static long | Returns: newly-created encodercomments associated with the stream comments, int input sampling rate (48 kHz is faster) rate, int number of channels channels, int mapping family (0 for mono/stereo, 1 for surround) family, IntBuffer error code ( error)NULL if no error is to be returned)Create a new OggOpus stream to be used along with |
| private static int | |
| public static int | Returns: error codeencoder enc, int use a request macro request)Sets encoder options. |
| public static int | Returns: error codeencoder enc, Opus.use a request macro requestSets encoder options. |
| public static int | Returns: error codeencoder enc, int mapping family ( family, int 0 for mono/stereo, 1 for surround)total number of streams streams, int number of coupled streams coupled_streams, ByteBuffer channel mapping mapping)Deferred initialization of the encoder to force an explicit channel mapping. |
| public static void | |
| public static int | Returns: error codeencoder enc)Finalizes the stream, but does not deallocate the object. |
| public static int | Returns: error codeencoder enc)Write out the header now rather than wait for audio to begin. |
| public static boolean | Returns: 1 if there is a page available, 0 if notencoder enc, PointerBuffer next available encoded page page, IntBuffer size (in bytes) of the page returned len, boolean if non-zero, forces a flush of the page (if any data available) flush)Get the next page from the stream (only if using |
| public static int | Returns: error codeencoder enc, ShortBuffer linear 16-bit PCM values in the pcm, int [-32768,32767] range (interleaved if multiple channels)number of samples for each channel samples_per_channel)Add/encode any number of 16-bit linear samples to the stream. |
| public static int | Returns: error codeencoder enc, FloatBuffer floating-point PCM values in the pcm, int +/-1 range (interleaved if multiple channels)number of samples for each channel samples_per_channel)Add/encode any number of float samples to the stream. |
| public static int | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static String | Returns: a string describing the version of this libraryReturns a string representing the version of libopusenc being used at run time. |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static Opus. | |
| public static String | Returns: error stringerror number error)Converts a libopusenc error code into a human readable string. |