FunctionsAndGlobals class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
opus_decode(Pointer<OpusDecoder> st, Pointer<Uint8> data, int len, Pointer<Int16> pcm, int frame_size, int decode_fec)
→ int
-
Decode an Opus packet.
@param
in
st OpusDecoder*: Decoder state
@param in
data char*: Input payload. Use a NULL pointer to indicate packet loss
@param in
len opus_int32: Number of bytes in payload*
@param out
pcm opus_int16*: Output signal (interleaved if 2 channels). length
is frame_sizechannelssizeof(opus_int16)
@param in
frame_size Number of samples per channel of available space in a pcm.
If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will
not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),
then frame_size needs to be exactly the duration of audio that is missing, otherwise the
decoder will not be in the optimal state to decode the next incoming packet. For the PLC and
FEC cases, frame_size must be a multiple of 2.5 ms.
@param in
decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be
decoded. If no such data is available, the frame is decoded as if it were lost.
@returns Number of decoded samples or @ref opus_errorcodes
-
opus_decode_float(Pointer<OpusDecoder> st, Pointer<Uint8> data, int len, Pointer<Float> pcm, int frame_size, int decode_fec)
→ int
-
Decode an Opus packet with floating point output.
@param
in
st OpusDecoder*: Decoder state
@param in
data char*: Input payload. Use a NULL pointer to indicate packet loss
@param in
len opus_int32: Number of bytes in payload
@param out
pcm float*: Output signal (interleaved if 2 channels). length
is frame_sizechannelssizeof(float)
@param in
frame_size Number of samples per channel of available space in a pcm.
If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will
not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),
then frame_size needs to be exactly the duration of audio that is missing, otherwise the
decoder will not be in the optimal state to decode the next incoming packet. For the PLC and
FEC cases, frame_size must be a multiple of 2.5 ms.
@param in
decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be
decoded. If no such data is available the frame is decoded as if it were lost.
@returns Number of decoded samples or @ref opus_errorcodes
-
opus_decoder_create(int Fs, int channels, Pointer<Int32> error)
→ Pointer<OpusDecoder>
-
Allocates and initializes a decoder state.
@param
in
Fs opus_int32: Sample rate to decode at (Hz).
This must be one of 8000, 12000, 16000,
24000, or 48000.
@param in
channels int: Number of channels (1 or 2) to decode
@param out
error int*: #OPUS_OK Success or @ref opus_errorcodes
-
opus_decoder_destroy(Pointer<OpusDecoder> st)
→ void
-
Frees an
OpusDecoder
allocated by opus_decoder_create().
@param in
st OpusDecoder*: State to be freed.
-
opus_decoder_get_nb_samples(Pointer<OpusDecoder> dec, Pointer<Uint8> packet, int len)
→ int
-
Gets the number of samples of an Opus packet.
@param
in
dec OpusDecoder*: Decoder state
@param in
packet char*: Opus packet
@param in
len opus_int32: Length of packet
@returns Number of samples
@retval OPUS_BAD_ARG Insufficient data was passed to the function
@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
-
opus_decoder_get_size(int channels)
→ int
-
Gets the size of an
OpusDecoder
structure.
@param in
channels int: Number of channels.
This must be 1 or 2.
@returns The size in bytes.
-
opus_decoder_init(Pointer<OpusDecoder> st, int Fs, int channels)
→ int
-
Initializes a previously allocated decoder state.
The state must be at least the size returned by opus_decoder_get_size().
This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size
To reset a previously initialized state, use the #OPUS_RESET_STATE CTL.
@param
in
st OpusDecoder*: Decoder state.
@param in
Fs opus_int32: Sampling rate to decode to (Hz).
This must be one of 8000, 12000, 16000,
24000, or 48000.
@param in
channels int: Number of channels (1 or 2) to decode
@retval #OPUS_OK Success or @ref opus_errorcodes
-
opus_packet_get_bandwidth(Pointer<Uint8> data)
→ int
-
Gets the bandwidth of an Opus packet.
@param
in
data char*: Opus packet
@retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass)
@retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass)
@retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass)
@retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass)
@retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass)
@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
-
opus_packet_get_nb_channels(Pointer<Uint8> data)
→ int
-
Gets the number of channels from an Opus packet.
@param
in
data char*: Opus packet
@returns Number of channels
@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
-
opus_packet_get_nb_frames(Pointer<Uint8> packet, int len)
→ int
-
Gets the number of frames in an Opus packet.
@param
in
packet char*: Opus packet
@param in
len opus_int32: Length of packet
@returns Number of frames
@retval OPUS_BAD_ARG Insufficient data was passed to the function
@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
-
opus_packet_get_nb_samples(Pointer<Uint8> packet, int len, int Fs)
→ int
-
Gets the number of samples of an Opus packet.
@param
in
packet char*: Opus packet
@param in
len opus_int32: Length of packet
@param in
Fs opus_int32: Sampling rate in Hz.
This must be a multiple of 400, or
inaccurate results will be returned.
@returns Number of samples
@retval OPUS_BAD_ARG Insufficient data was passed to the function
@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
-
opus_packet_get_samples_per_frame(Pointer<Uint8> data, int Fs)
→ int
-
Gets the number of samples per frame from an Opus packet.
@param
in
data char*: Opus packet.
This must contain at least one byte of
data.
@param in
Fs opus_int32: Sampling rate in Hz.
This must be a multiple of 400, or
inaccurate results will be returned.
@returns Number of samples per frame.
-
opus_packet_parse(Pointer<Uint8> data, int len, Pointer<Uint8> out_toc, Pointer<Uint8> frames, int size, Pointer<Int32> payload_offset)
→ int
-
Parse an opus packet into one or more frames.
Opus_decode will perform this operation internally so most applications do
not need to use this function.
This function does not copy the frames, the returned pointers are pointers into
the input packet.
@param
in
data char*: Opus packet to be parsed
@param in
len opus_int32: size of data
@param out
out_toc char*: TOC pointer
@param out
frames char*48
encapsulated frames
@param out
size opus_int1648
sizes of the encapsulated frames
@param out
payload_offset int*: returns the position of the payload within the packet (in bytes)
@returns number of frames
-
opus_pcm_soft_clip(Pointer<Float> pcm, int frame_size, int channels, Pointer<Float> softclip_mem)
→ void
-
Applies soft-clipping to bring a float signal within the
-1,1
range. If
the signal is already in that range, nothing is done. If there are values
outside of -1,1
, then the signal is clipped as smoothly as possible to
both fit in the range and avoid creating excessive distortion in the
process.
@param in,out
pcm float*: Input PCM and modified PCM
@param in
frame_size int Number of samples per channel to process
@param in
channels int: Number of channels
@param in,out
softclip_mem float*: State memory for the soft clipping process (one float per channel, initialized to zero)
-
toString()
→ String
-
A string representation of this object.
inherited