This is the documentation for the libopusfile C API.
The libopusfile package provides a convenient high-level API for decoding and basic manipulation of all Ogg Opus audio streams. libopusfile is implemented as a layer on top of Xiph.Org's reference libogg and libopus libraries.
libopusfile provides several sets of built-in routines for file/stream access, and may also use custom stream I/O routines provided by the embedded
environment. There are built-in I/O routines provided for ANSI-compliant stdio (FILE *), memory buffers, and URLs (including
file: URLs, plus optionally http: and https: URLs).
The main API is divided into several sections:
Several additional sections are not tied to the main API.
The libopusfile API always decodes files to 48 kHz. The original sample rate is not preserved by the lossy compression, though it is stored in the header to allow you to resample to it after decoding (the libopusfile API does not currently provide a resampler, but the the Speex resampler is a good choice if you need one). In general, if you are playing back the audio, you should leave it at 48 kHz, provided your audio hardware supports it. When decoding to a file, it may be worth resampling back to the original sample rate, so as not to surprise users who might not expect the sample rate to change after encoding to Opus and decoding.
Opus files can contain anywhere from 1 to 255 channels of audio. The channel mappings for up to 8 channels are the same as the Vorbis mappings. A special stereo API can convert everything to 2 channels, making it simple to support multichannel files in an application which only has stereo output. Although the libopusfile ABI provides support for the theoretical maximum number of channels, the current implementation does not support files with more than 8 channels, as they do not have well-defined channel mappings.
Like all Ogg files, Opus files may be "chained". That is, multiple Opus files may be combined into a single, longer file just by concatenating the original files. This is commonly done in internet radio streaming, as it allows the title and artist to be updated each time the song changes, since each link in the chain includes its own set of metadata.
libopusfile fully supports chained files. It will decode the first Opus stream found in each link of a chained file (ignoring any other streams that might be concurrently multiplexed with it, such as a video stream).
The channel count can also change between links. If your application is not prepared to deal with this, it can use the stereo API to ensure the audio from all links will always get decoded into a common format. Since libopusfile always decodes to 48 kHz, you do not have to worry about the sample rate changing between links (as was possible with Vorbis). This makes application support for chained files with libopusfile very easy.
| Modifier and Type | Class and Description |
|---|---|
| public static class | OpusFile.
Contains the function pointers loaded from |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | OP_ABSOLUTE_GAIN
Gain offset type that indicates that the provided offset should be used as the gain directly, without applying any the header or track gains. |
| public static final int | OP_ALBUM_GAIN
Gain offset type that indicates that the provided offset is relative to the |
| public static final int | OP_DEC_FORMAT_FLOAT
Indicates that the decoding callback should produce 32-bit native-endian float samples. |
| public static final int | OP_DEC_FORMAT_SHORT
Indicates that the decoding callback should produce signed 16-bit native-endian output samples. |
| public static final int | OP_DEC_USE_DEFAULT
Indicates that the decoding callback did not decode anything, and that libopusfile should decode normally instead. |
| public static final int | OP_EBADHEADER
Error codes. |
| public static final int | OP_EBADLINK
Error codes. |
| public static final int | OP_EBADPACKET
Error codes. |
| public static final int | OP_EBADTIMESTAMP
Error codes. |
| public static final int | OP_EFAULT
Error codes. |
| public static final int | OP_EIMPL
Error codes. |
| public static final int | OP_EINVAL
Error codes. |
| public static final int | OP_ENOSEEK
Error codes. |
| public static final int | OP_ENOTAUDIO
Error codes. |
| public static final int | OP_ENOTFORMAT
Error codes. |
| public static final int | OP_EOF
Error codes. |
| public static final int | OP_EREAD
Error codes. |
| public static final int | OP_EVERSION
Error codes. |
| public static final int | OP_FALSE
Error codes. |
| public static final int | OP_GET_SERVER_INFO_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_HEADER_GAIN
Gain offset type that indicates that the provided offset is relative to the header gain. |
| public static final int | OP_HOLE
Error codes. |
| public static final int | OP_HTTP_PROXY_HOST_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_HTTP_PROXY_PASS_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_HTTP_PROXY_PORT_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_HTTP_PROXY_USER_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_PIC_FORMAT_GIF
Picture tag image formats. |
| public static final int | OP_PIC_FORMAT_JPEG
Picture tag image formats. |
| public static final int | OP_PIC_FORMAT_PNG
Picture tag image formats. |
| public static final int | OP_PIC_FORMAT_UNKNOWN
Picture tag image formats. |
| public static final int | OP_PIC_FORMAT_URL
Picture tag image formats. |
| public static final int | OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST
These are the raw numbers used to define the request codes. |
| public static final int | OP_TRACK_GAIN
Gain offset type that indicates that the provided offset is relative to the |
| public static final int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static long | |
| public static long | |
| public static long | |
| public static long | |
| public static long | nop_mem_stream_create(long _cb, long _data, long
the size of the block of memory _size)Unsafe version of: |
| public static long | nop_open_callbacks(long _stream, long _cb, long _initial_data, long
the number of bytes in _initial_bytes, long _error)_initial_data.
If the stream is seekable, its current position (as reported by Unsafe version of: |
| public static long | |
| public static long | nop_open_memory(long _data, long
the number of bytes in the buffer _size, long _error)Unsafe version of: |
| public static int | nop_read(long _of, long _pcm, int
the number of values that can be stored in _buf_size, long _li)_pcm.
It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (5760 values per channel). Smaller buffers will
simply return less data, possibly consuming more memory to buffer the data internally. libopusfile may return less data than requested. If so,
there is no guarantee that the remaining data in Unsafe version of: |
| public static int | nop_read_float(long _of, long _pcm, int
the number of floats that can be stored in _buf_size, long _li)_pcm.
It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (5760 samples per channel). Smaller buffers will
simply return less data, possibly consuming more memory to buffer the data internally. If less than Unsafe version of: |
| public static int | nop_read_float_stereo(long _of, long _pcm, int
the number of values that can be stored in _buf_size)_pcm.
It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (11520 values total). Smaller buffers will simply
return less data, possibly consuming more memory to buffer the data internally. If less than Unsafe version of: |
| public static int | nop_read_stereo(long _of, long _pcm, int
the number of values that can be stored in _buf_size)_pcm.
It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (11520 values total). Smaller buffers will simply
return less data, possibly consuming more memory to buffer the data internally. If less than Unsafe version of: |
| public static void | nop_set_decode_callback(long _of, long _decode_cb, long _ctx)
Unsafe version of: |
| public static long | |
| public static int | |
| public static long | nop_test_callbacks(long _stream, long _cb, long _initial_data, long
the number of bytes in _initial_bytes, long _error)_initial_data.
If the stream is seekable, its current position (as reported by Unsafe version of: |
| public static long | |
| public static long | nop_test_memory(long _data, long
the number of bytes in the buffer _size, long _error)Unsafe version of: |
| public static long | |
| public static int | nopus_head_parse(long _head, long _data, long
the number of bytes of data in the ID header packet _len)Unsafe version of: |
| public static void | |
| public static void | |
| public static int | |
| public static int | |
| public static int | nopus_tagncompare(long _tag_name, int
the number of characters in the tag name. This must be non-negative. _tag_len, long _comment)Unsafe version of: |
| public static int | |
| public static int | |
| public static void | |
| public static int | |
| public static int | |
| public static long | nopus_tags_get_binary_suffix(long _tags, long
returns the number of bytes of binary suffix data returned _len)Unsafe version of: |
| public static int | |
| public static void | |
| public static int | nopus_tags_parse(long _tags, long _data, long
the number of bytes of data in the 'info' header packet _len)Unsafe version of: |
| public static long | |
| public static int | |
| public static int | nopus_tags_set_binary_suffix(long _tags, long _data, int
the number of bytes of binary data to append. This may be zero to remove any existing binary suffix data. _len)Unsafe version of: |
| public static int | Returns: the bitrate on success, or a negative value on error.
the _of, int OggOpusFile from which to retrieve the bitratethe index of the link whose bitrate should be computed. Use a negative number to get the bitrate of the whole stream. _li)Computes the bitrate of the stream, or of an individual link in a (possibly-chained) Ogg Opus stream. |
| public static int | op_bitrate_instant(long
the _of)OggOpusFile from which to retrieve the bitrateCompute the instantaneous bitrate, measured as the ratio of bits to playable samples decoded since
|
| public static int | Returns: the channel count of the given link.If the _of, int OggOpusFile from which to retrieve the channel countthe index of the link whose channel count should be retrieved. Use a negative number to get the channel count of the current link. _li)Get the channel count of the given link in a (possibly-chained) Ogg Opus stream. |
| public static int | Returns: the index of the current link on success, or a negative value on failure.For seekable streams, this is a number between 0 (inclusive) and the value returned by
the _of)OggOpusFile from which to retrieve the current link indexRetrieve the index of the current link. |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, int the file descriptor to open _fd, ByteBuffer the mode to open the file in _mode)Opens a stream with |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, int the file descriptor to open _fd, CharSequence the mode to open the file in _mode)Opens a stream with |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, ByteBuffer the path to the file to open. On Windows, this string must be UTF-8 (to allow access to files whose names cannot be represented in the current MBCS
code page). All other systems use the native character encoding. _path, ByteBuffer the mode to open the file in _mode)Opens a stream with |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, CharSequence the path to the file to open. On Windows, this string must be UTF-8 (to allow access to files whose names cannot be represented in the current MBCS
code page). All other systems use the native character encoding. _path, CharSequence the mode to open the file in _mode)Opens a stream with |
| public static void | |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, ByteBuffer the path to the file to open. On Windows, this string must be UTF-8 (to allow access to files whose names cannot be represented in the current MBCS
code page). All other systems use the native character encoding. _path, ByteBuffer the mode to open the file in _mode, long _stream)Opens a stream with |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this file. If there is an error opening the file, nothing will be filled in here. _cb, CharSequence the path to the file to open. On Windows, this string must be UTF-8 (to allow access to files whose names cannot be represented in the current MBCS
code page). All other systems use the native character encoding. _path, CharSequence the mode to open the file in _mode, long _stream)Opens a stream with |
| public static OpusHead | Returns: the contents of the ID header for the given linkthe _of, int OggOpusFile from which to retrieve the ID header informationthe index of the link whose ID header information should be retrieved. Use a negative number to get the ID header information of the current link.
For an unseekable stream, _li)_li is ignored, and the ID header information for the current link is always returned, if available.Get the ID header information for the given link in a (possibly chained) Ogg Opus stream. |
| public static int | Returns: for fully-open seekable streams, this returns the total number of links in the whole stream, which will be at least 1. For partially-open or unseekable streams, this always returns 1.the _of)OggOpusFile from which to retrieve the link countReturns the number of links in this chained stream. |
| public static long | Returns: a stream handle to use with the callbacks, orNULL on errorthe callbacks to use for this stream. If there is an error creating the stream, nothing will be filled in here. _cb, ByteBuffer the block of memory to read from _data)Creates a stream that reads from the given block of memory. |
| public static long | Returns: a freshly openedOggOpusFile, or NULL on error.
libopusfile does not take ownership of the stream if the call fails. The calling application is responsible for closing the stream if this call returns an error. the stream to read from (e.g., a _stream, OpusFileCallbacks FILE *). This value will be passed verbatim as the first argument to all of the callbacks.the callbacks with which to access the stream.
_cb, ByteBuffer
an initial buffer of data from the start of the stream.
_initial_data, IntBuffer Applications can read some number of bytes from the start of the stream to help identify this as an Opus stream, and then provide them here to allow the stream to be opened, even if it is unseekable. returns 0 on success, or a failure code on error.
_error)You may pass in
Open a stream using the given set of callbacks to access it. |
| public static long | Returns: a freshly openedOggOpusFile, or NULL on errorthe path to the file to open _path, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Open a stream from the given file path. |
| public static long | Returns: a freshly openedOggOpusFile, or NULL on errorthe path to the file to open _path, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Open a stream from the given file path. |
| public static long | Returns: a freshly openedOggOpusFile, or NULL on errorthe memory buffer to open _data, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Open a stream from a memory buffer. |
| public static int | Returns: 0 on success, or a negative value on error:
the _of, long OggOpusFile in which to seekthe PCM offset to seek to. This is in samples at 48 kHz relative to the start of the stream. _pcm_offset)Seek to the specified PCM offset, such that decoding will begin at exactly the requested position. |
| public static long | Returns: the PCM offset of the next sample to be read.EINVAL The stream was only partially open.the _of)OggOpusFile from which to retrieve the PCM offsetObtain the PCM offset of the next sample to be read. |
| public static long | Returns: the PCM length of the entire stream if_li is negative, the PCM length of link _li if it is non-negative, or a negative value on error.
the _of, int OggOpusFile from which to retrieve the PCM offsetthe index of the link whose PCM length should be computed. Use a negative number to get the PCM length of the entire stream. _li)Get the total PCM length (number of samples at 48 kHz) of the stream, or of an individual link in a (possibly-chained) Ogg Opus stream. |
| public static int | Returns: 0 on success, or a negative error code on failure:the _of, long OggOpusFile in which to seekthe byte position to seek to. This must be between 0 and _byte_offset)op_raw_total(_of, -1) (inclusive).Seek to a byte offset relative to the compressed data. |
| public static long | Returns: the byte position that is currently being read from.EINVAL The stream was only partially open.the _of)OggOpusFile from which to retrieve the position indicatorObtain the current value of the position indicator for |
| public static long | Returns: the compressed size of the entire stream if_li is negative, the compressed size of link _li if it is non-negative, or a negative value
on error.
The compressed size of the entire stream may be smaller than that of the underlying stream if trailing garbage was detected in the file.
the _of, int OggOpusFile from which to retrieve the compressed sizethe index of the link whose compressed size should be computed. Use a negative number to get the compressed size of the entire stream. _li)Get the total (compressed) size of the stream, or of an individual link in a (possibly-chained) Ogg Opus stream, including all headers and Ogg muxing overhead. |
| public static int | Returns: the number of samples read per channel on success, or a negative value on failure.The channel count can be retrieved on success by calling
the _of, ShortBuffer OggOpusFile from which to reada buffer in which to store the output PCM samples, as signed native-endian 16-bit values at 48 kHz with a nominal range of _pcm, IntBuffer [-32768,32767).
Multiple channels are interleaved using the Vorbis channel ordering.
This must have room for at least _buf_size values.the index of the link this data was decoded from.
_li)You may pass Reads more samples from the stream. |
| public static int | Returns: the number of samples read per channel on success, or a negative value on failure.The channel count can be retrieved on success by calling
the _of, FloatBuffer OggOpusFile from which to reada buffer in which to store the output PCM samples as signed floats at 48 kHz with a nominal range of _pcm, IntBuffer [-1.0,1.0].
Multiple channels are interleaved using the Vorbis channel ordering.
This must have room for at least the index of the link this data was decoded from.
_li)You may pass Reads more samples from the stream. |
| public static int | Returns: the number of samples read per channel on success, or a negative value on failure.The number of samples returned may be 0 if the buffer was too small to store even a single sample for both channels, or if end-of-file was reached. The list of possible failure codes follows. Most of them can only be returned by unseekable, chained streams that encounter a new link.
the _of, FloatBuffer OggOpusFile from which to reada buffer in which to store the output PCM samples, as signed floats at 48 kHz with a nominal range of _pcm)[-1.0,1.0].
The left and right channels are interleaved in the buffer. This must have room for at least Reads more samples from the stream and downmixes to stereo, if necessary. |
| public static int | Returns: the number of samples read per channel on success, or a negative value on failure.The number of samples returned may be 0 if the buffer was too small to store even a single sample for both channels, or if end-of-file was reached. The list of possible failure codes follows. Most of them can only be returned by unseekable, chained streams that encounter a new link.
the _of, ShortBuffer OggOpusFile from which to reada buffer in which to store the output PCM samples, as signed native-endian 16-bit values at 48 kHz with a nominal range of _pcm)[-32768,32767).
The left and right channels are interleaved in the buffer. This must have room for at least Reads more samples from the stream and downmixes to stereo, if necessary. |
| public static boolean | Returns: a non-zero value if seekable, and 0 if unseekablethe _of)OggOpusFile whose seekable status is to be returnedReturns whether or not the stream being read is seekable. |
| public static int | Returns: the serial number of the given link.If the _of, int OggOpusFile from which to retrieve the serial numberthe index of the link whose serial number should be retrieved. Use a negative number to get the serial number of the current link. _li)Get the serial number of the given link in a (possibly-chained) Ogg Opus stream. |
| public static void | op_set_decode_callback(long
the _of, OPDecodeCBFuncI OggOpusFile on which to set the decode callbackthe callback function to call. This may be _decode_cb, long NULL to disable calling the callback.the application-provided context pointer to pass to the callback on each call _ctx)Sets the packet decode callback function. |
| public static void | op_set_dither_enabled(long
the _of, boolean OggOpusFile on which to enable or disable ditheringa non-zero value to enable dithering, or 0 to disable it _enabled)Sets whether or not dithering is enabled for 16-bit decoding. |
| public static int | op_set_gain_offset(long
the _of, int _gain_type, int OggOpusFile on which to set the gain offsetthe gain offset to apply, in _gain_offset_q8)1/256ths of a dBSets the gain to be used for decoded output. |
| public static OpusTags | Returns: the contents of the comment header for the given link, orNULL if this is an unseekable stream that encountered an invalid linkthe _of, int OggOpusFile from which to retrieve the comment header informationthe index of the link whose comment header information should be retrieved. Use a negative number to get the comment header information of the
current link. For an unseekable stream, _li)_li is ignored, and the comment header information for the current link is always returned, if
available.Get the comment header information for the given link in a (possibly chained) Ogg Opus stream. |
| public static int | Returns: 0 if the data appears to be Opus, or a negative value on error.
the parsed ID header contents. You may pass _head, ByteBuffer NULL if you do not need this information. If the function fails, the contents of this structure remain
untouched.an initial buffer of data from the start of the stream _initial_data)Test to see if this is an Opus stream. |
| public static long | Returns: a partially openedOggOpusFile, or NULL on error.
libopusfile does not take ownership of the stream if the call fails. The calling application is responsible for closing the stream if this call returns an error. the stream to read from (e.g., a _stream, OpusFileCallbacks FILE *). This value will be passed verbatim as the first argument to all of the callbacks.the callbacks with which to access the stream.
_cb, ByteBuffer
an initial buffer of data from the start of the stream.
_initial_data, IntBuffer Applications can read some number of bytes from the start of the stream to help identify this as an Opus stream, and then provide them here to allow the stream to be tested more thoroughly, even if it is unseekable. returns 0 on success, or a failure code on error.
_error)You may pass in Partially open a stream using the given set of callbacks to access it. |
| public static long | Returns: a partially openedOggOpusFile, or NULL on errorthe path to the file to open _path, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Partially open a stream from the given file path. |
| public static long | Returns: a partially openedOggOpusFile, or NULL on errorthe path to the file to open _path, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Partially open a stream from the given file path. |
| public static long | Returns: a partially openedOggOpusFile, or NULL on errorthe memory buffer to open _data, IntBuffer returns 0 on success, or a failure code on error.
_error)You may pass in Partially open a stream from a memory buffer. |
| public static int | Returns: 0 on success, or a negative value on error:
the _of)OggOpusFile to finish openingFinish opening a stream partially opened with |
| public static long | Returns: the sample offset associated with the given granule position (counting at a 48 kHz sampling rate), or the special value-1 on error (i.e., the
granule position was smaller than the pre-skip amount)the _head, long OpusHead information from the ID header of the streamthe granule position to convert _gp)Converts a granule position to a sample offset for a given Ogg Opus stream. |
| public static int | Returns: 0 on success or a negative value on error:
returns the contents of the parsed packet. The contents of this structure are untouched on error. This may be _head, ByteBuffer NULL to merely test the header for
validity.the contents of the ID header packet _data)Parses the contents of the ID header packet of an Ogg Opus stream. |
| public static void | opus_picture_tag_clear(OpusPictureTag
the _pic)OpusPictureTag structure to clearClears the |
| public static void | opus_picture_tag_init(OpusPictureTag
the _pic)OpusPictureTag structure to initializeInitializes an |
| public static int | Returns: 0 on success, or a negative value on failure:
returns the parsed picture data.
_pic, ByteBuffer No sanitation is done on the type, MIME type, or description fields, so these might return invalid values. The contents of this structure are left unmodified on failure. the _tag)METADATA_BLOCK_PICTURE tag contents. The leading "METADATA_BLOCK_PICTURE=" portion is optional, to allow the function to be
used on either directly on the values in OpusTags::user_comments or on the return value of tags_query.Parse a single |
| public static int | Returns: 0 on success, or a negative value on failure:
returns the parsed picture data.
_pic, CharSequence No sanitation is done on the type, MIME type, or description fields, so these might return invalid values. The contents of this structure are left unmodified on failure. the _tag)METADATA_BLOCK_PICTURE tag contents. The leading "METADATA_BLOCK_PICTURE=" portion is optional, to allow the function to be
used on either directly on the values in OpusTags::user_comments or on the return value of tags_query.Parse a single |
| public static int | Returns: an integer less than, equal to, or greater than zero if_comment is found respectively, to be less than, to match, or be greater than a
"tag=value" string whose tag matches _tag_namea _tag_name, ByteBuffer NUL-terminated, case-insensitive, ASCII string containing the name of the tag to check for (without the terminating '=' character)the comment string to check _comment)Check if |
| public static int | Returns: an integer less than, equal to, or greater than zero if_comment is found respectively, to be less than, to match, or be greater than a
"tag=value" string whose tag matches _tag_namea _tag_name, CharSequence NUL-terminated, case-insensitive, ASCII string containing the name of the tag to check for (without the terminating '=' character)the comment string to check _comment)Check if |
| public static int | Returns: an integer less than, equal to, or greater than zero if_comment is found respectively, to be less than, to match, or be greater than a
"tag=value" string whose tag matches the first _tag_len characters of _tag_namea case-insensitive ASCII string containing the name of the tag to check for (without the terminating _tag_name, ByteBuffer '=' character)the comment string to check _comment)Check if |
| public static int | Returns: an integer less than, equal to, or greater than zero if_comment is found respectively, to be less than, to match, or be greater than a
"tag=value" string whose tag matches the first _tag_len characters of _tag_namea case-insensitive ASCII string containing the name of the tag to check for (without the terminating _tag_name, CharSequence '=' character)the comment string to check _comment)Check if |
| public static int | Returns: 0 on success, or a negative value on failure:
the _tags, ByteBuffer OpusTags structure to add the (tag, value) pair toa _tag, ByteBuffer NUL-terminated, case-insensitive, ASCII string containing the tag to add (without an '=' character)a _value)NUL-terminated UTF-8 containing the corresponding valueAdd a (tag, value) pair to an initialized |
| public static int | Returns: 0 on success, or a negative value on failure:
the _tags, CharSequence OpusTags structure to add the (tag, value) pair toa _tag, CharSequence NUL-terminated, case-insensitive, ASCII string containing the tag to add (without an '=' character)a _value)NUL-terminated UTF-8 containing the corresponding valueAdd a (tag, value) pair to an initialized |
| public static int | Returns: 0 on success, or a negative value on failure:
the _tags, ByteBuffer OpusTags structure to add the comment toa _comment)NUL-terminated UTF-8 string containing the comment in "TAG=value" formAdd a comment to an initialized |
| public static int | Returns: 0 on success, or a negative value on failure:
the _tags, CharSequence OpusTags structure to add the comment toa _comment)NUL-terminated UTF-8 string containing the comment in "TAG=value" formAdd a comment to an initialized |
| public static void | |
| public static int | Returns:
the _dst, OpusTags OpusTags structure to copy into. If this function fails, the contents of this structure remain untouched.the _src)OpusTags structure to copy fromPerforms a deep copy of an |
| public static int | Returns: 0 on success, or a negative value on failure:
an initialized _tags, IntBuffer OpusTags structurethe album gain, in _gain_q8)1/256ths of a dB. This will lie in the range [-32768,32767], and should be applied in addition to the
header gain. On error, no value is returned, and the previous contents remain unchanged.Get the album gain from an |
| public static ByteBuffer | Returns: a pointer to the binary suffix data, orNULL if none was presentan initialized _tags)OpusTags structureRetrieve the binary suffix data at the end of the packet (if any). |
| public static int | Returns: 0 on success, or a negative value on failure:
an initialized _tags, IntBuffer OpusTags structurethe track gain, in _gain_q8)1/256ths of a dB. This will lie in the range [-32768,32767], and should be applied in addition to the
header gain. On error, no value is returned, and the previous contents remain unchanged.Get the track gain from an |
| public static void | opus_tags_init(OpusTags
the _tags)OpusTags structure to initializeInitializes an |
| public static int | Returns:
an uninitialized _tags, ByteBuffer OpusTags structure. This returns the contents of the parsed packet. The contents of this structure are untouched on error.
This may be NULL to merely test the header for validity.the contents of the 'comment' header packet _data)Parses the contents of the 'comment' header packet of an Ogg Opus stream. |
| public static String | Returns: a pointer to the queried tag's value.This points directly to data in the an initialized _tags, ByteBuffer OpusTags structurethe tag to look up _tag, int the instance of the tag.
_count)The same tag can appear multiple times, each with a distinct value, so an index is required to retrieve them all. The order in which these values
appear is significant and should be preserved. Use Look up a comment value by its tag. |
| public static String | Returns: a pointer to the queried tag's value.This points directly to data in the an initialized _tags, CharSequence OpusTags structurethe tag to look up _tag, int the instance of the tag.
_count)The same tag can appear multiple times, each with a distinct value, so an index is required to retrieve them all. The order in which these values
appear is significant and should be preserved. Use Look up a comment value by its tag. |
| public static int | Returns: the number of instances of this particular tagan initialized _tags, ByteBuffer OpusTags structurethe tag to look up _tag)Look up the number of instances of a tag. |
| public static int | Returns: the number of instances of this particular tagan initialized _tags, CharSequence OpusTags structurethe tag to look up _tag)Look up the number of instances of a tag. |
| public static int | opus_tags_set_binary_suffix(OpusTags
an initialized _tags, ByteBuffer OpusTags structurea buffer of binary data to append after the encoded user comments. The least significant bit of the first byte of this data must be set (to ensure
the data is preserved by other editors). _data)Replace the binary suffix data at the end of the packet (if any). |