deimos.flac.stream_encoder

Undocumented in source.

Members

Aliases

FLAC__StreamEncoderMetadataCallback
alias FLAC__StreamEncoderMetadataCallback = void function(const FLAC__StreamEncoder* encoder, const FLAC__StreamMetadata* metadata, void* client_data)

Signature for the metadata callback.

FLAC__StreamEncoderProgressCallback
alias FLAC__StreamEncoderProgressCallback = void function(const FLAC__StreamEncoder* encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint frames_written, uint total_frames_estimate, void* client_data)

Signature for the progress callback.

FLAC__StreamEncoderReadCallback
alias FLAC__StreamEncoderReadCallback = FLAC__StreamEncoderReadStatus function(const FLAC__StreamEncoder* encoder, FLAC__byte* buffer, size_t* bytes, void* client_data)

Signature for the read callback.

FLAC__StreamEncoderSeekCallback
alias FLAC__StreamEncoderSeekCallback = FLAC__StreamEncoderSeekStatus function(const FLAC__StreamEncoder* encoder, FLAC__uint64 absolute_byte_offset, void* client_data)

Signature for the seek callback.

FLAC__StreamEncoderTellCallback
alias FLAC__StreamEncoderTellCallback = FLAC__StreamEncoderTellStatus function(const FLAC__StreamEncoder* encoder, FLAC__uint64* absolute_byte_offset, void* client_data)

Signature for the tell callback.

FLAC__StreamEncoderWriteCallback
alias FLAC__StreamEncoderWriteCallback = FLAC__StreamEncoderWriteStatus function(const FLAC__StreamEncoder* encoder, const FLAC__byte* buffer, size_t bytes, uint samples, uint current_frame, void* client_data)

Signature for the write callback.

Enums

FLAC__StreamEncoderInitStatus
enum FLAC__StreamEncoderInitStatus

Possible return values for the FLAC__stream_encoder_init_*() functions.

FLAC__StreamEncoderReadStatus
enum FLAC__StreamEncoderReadStatus

Return values for the FLAC__StreamEncoder read callback.

FLAC__StreamEncoderSeekStatus
enum FLAC__StreamEncoderSeekStatus

Return values for the FLAC__StreamEncoder seek callback.

FLAC__StreamEncoderState
enum FLAC__StreamEncoderState

State values for a FLAC__StreamEncoder.

FLAC__StreamEncoderTellStatus
enum FLAC__StreamEncoderTellStatus

Return values for the FLAC__StreamEncoder tell callback.

FLAC__StreamEncoderWriteStatus
enum FLAC__StreamEncoderWriteStatus

Return values for the FLAC__StreamEncoder write callback.

Functions

FLAC__stream_encoder_delete
void FLAC__stream_encoder_delete(FLAC__StreamEncoder* encoder)

Free an encoder instance. Deletes the object pointed to by \a encoder.

FLAC__stream_encoder_finish
FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder* encoder)

Finish the encoding process. Flushes the encoding buffer, releases resources, resets the encoder settings to their defaults, and returns the encoder state to FLAC__STREAM_ENCODER_UNINITIALIZED. Note that this can generate one or more write callbacks before returning, and will generate a metadata callback.

FLAC__stream_encoder_get_bits_per_sample
uint FLAC__stream_encoder_get_bits_per_sample(FLAC__StreamEncoder* encoder)

Get the input sample resolution setting.

FLAC__stream_encoder_get_blocksize
uint FLAC__stream_encoder_get_blocksize(FLAC__StreamEncoder* encoder)

Get the blocksize setting.

FLAC__stream_encoder_get_channels
uint FLAC__stream_encoder_get_channels(FLAC__StreamEncoder* encoder)

Get the number of input channels being processed.

FLAC__stream_encoder_get_do_escape_coding
FLAC__bool FLAC__stream_encoder_get_do_escape_coding(FLAC__StreamEncoder* encoder)

Get the "escape coding" flag.

FLAC__stream_encoder_get_do_exhaustive_model_search
FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(FLAC__StreamEncoder* encoder)

Get the exhaustive model search flag.

FLAC__stream_encoder_get_do_mid_side_stereo
FLAC__bool FLAC__stream_encoder_get_do_mid_side_stereo(FLAC__StreamEncoder* encoder)

Get the "mid/side stereo coding" flag.

FLAC__stream_encoder_get_do_qlp_coeff_prec_search
FLAC__bool FLAC__stream_encoder_get_do_qlp_coeff_prec_search(FLAC__StreamEncoder* encoder)

Get the qlp coefficient precision search flag.

FLAC__stream_encoder_get_loose_mid_side_stereo
FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(FLAC__StreamEncoder* encoder)

Get the "adaptive mid/side switching" flag.

FLAC__stream_encoder_get_max_lpc_order
uint FLAC__stream_encoder_get_max_lpc_order(FLAC__StreamEncoder* encoder)

Get the maximum LPC order setting.

FLAC__stream_encoder_get_max_residual_partition_order
uint FLAC__stream_encoder_get_max_residual_partition_order(FLAC__StreamEncoder* encoder)

Get maximum residual partition order setting.

FLAC__stream_encoder_get_min_residual_partition_order
uint FLAC__stream_encoder_get_min_residual_partition_order(FLAC__StreamEncoder* encoder)

Get the minimum residual partition order setting.

FLAC__stream_encoder_get_qlp_coeff_precision
uint FLAC__stream_encoder_get_qlp_coeff_precision(FLAC__StreamEncoder* encoder)

Get the quantized linear predictor coefficient precision setting.

FLAC__stream_encoder_get_resolved_state_string
const(char)* FLAC__stream_encoder_get_resolved_state_string(FLAC__StreamEncoder* encoder)

Get the current encoder state as a C string. This version automatically resolves \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR by getting the verify decoder's state.

FLAC__stream_encoder_get_rice_parameter_search_dist
uint FLAC__stream_encoder_get_rice_parameter_search_dist(FLAC__StreamEncoder* encoder)

Get the Rice parameter search distance setting.

FLAC__stream_encoder_get_sample_rate
uint FLAC__stream_encoder_get_sample_rate(FLAC__StreamEncoder* encoder)

Get the input sample rate setting.

FLAC__stream_encoder_get_state
FLAC__StreamEncoderState FLAC__stream_encoder_get_state(FLAC__StreamEncoder* encoder)

Get the current encoder state.

FLAC__stream_encoder_get_streamable_subset
FLAC__bool FLAC__stream_encoder_get_streamable_subset(FLAC__StreamEncoder* encoder)

Get the <A HREF="../format.html#subset>Subset</A> flag.

FLAC__stream_encoder_get_total_samples_estimate
FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(FLAC__StreamEncoder* encoder)

Get the previously set estimate of the total samples to be encoded. The encoder merely mimics back the value given to FLAC__stream_encoder_set_total_samples_estimate() since it has no other way of knowing how many samples the client will encode.

FLAC__stream_encoder_get_verify
FLAC__bool FLAC__stream_encoder_get_verify(FLAC__StreamEncoder* encoder)

Get the "verify" flag.

FLAC__stream_encoder_get_verify_decoder_error_stats
void FLAC__stream_encoder_get_verify_decoder_error_stats(FLAC__StreamEncoder* encoder, FLAC__uint64* absolute_sample, uint* frame_number, uint* channel, uint* sample, FLAC__int32* expected, FLAC__int32* got)

Get relevant values about the nature of a verify decoder error. Useful when the stream encoder state is \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR. The arguments should be addresses in which the stats will be returned, or NULL if value is not desired.

FLAC__stream_encoder_get_verify_decoder_state
FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(FLAC__StreamEncoder* encoder)

Get the state of the verify stream decoder. Useful when the stream encoder state is \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.

FLAC__stream_encoder_init_FILE
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(FLAC__StreamEncoder* encoder, FILE* file, FLAC__StreamEncoderProgressCallback progress_callback, void* client_data)

Initialize the encoder instance to encode native FLAC files.

FLAC__stream_encoder_init_file
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_file(FLAC__StreamEncoder* encoder, char* filename, FLAC__StreamEncoderProgressCallback progress_callback, void* client_data)

Initialize the encoder instance to encode native FLAC files.

FLAC__stream_encoder_init_ogg_FILE
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(FLAC__StreamEncoder* encoder, FILE* file, FLAC__StreamEncoderProgressCallback progress_callback, void* client_data)

Initialize the encoder instance to encode Ogg FLAC files.

FLAC__stream_encoder_init_ogg_file
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_file(FLAC__StreamEncoder* encoder, char* filename, FLAC__StreamEncoderProgressCallback progress_callback, void* client_data)

Initialize the encoder instance to encode Ogg FLAC files.

FLAC__stream_encoder_init_ogg_stream
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream(FLAC__StreamEncoder* encoder, FLAC__StreamEncoderReadCallback read_callback, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void* client_data)

Initialize the encoder instance to encode Ogg FLAC streams.

FLAC__stream_encoder_init_stream
FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_stream(FLAC__StreamEncoder* encoder, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void* client_data)

Initialize the encoder instance to encode native FLAC streams.

FLAC__stream_encoder_new
FLAC__StreamEncoder* FLAC__stream_encoder_new()

Create a new stream encoder instance. The instance is created with default settings; see the individual FLAC__stream_encoder_set_*() functions for each setting's default.

FLAC__stream_encoder_process
FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder* encoder, FLAC__int32** buffer, uint samples)

Submit data for encoding. This version allows you to supply the input data via an array of pointers, each pointer pointing to an array of \a samples samples representing one channel. The samples need not be block-aligned, but each channel should have the same number of samples. Each sample should be a signed integer, right-justified to the resolution set by FLAC__stream_encoder_set_bits_per_sample(). For example, if the resolution is 16 bits per sample, the samples should all be in the range [-32768,32767].

FLAC__stream_encoder_process_interleaved
FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder* encoder, FLAC__int32* buffer, uint samples)

Submit data for encoding. This version allows you to supply the input data where the channels are interleaved into a single array (i.e. channel0_sample0, channel1_sample0, ... , channelN_sample0, channel0_sample1, ...). The samples need not be block-aligned but they must be sample-aligned, i.e. the first value should be channel0_sample0 and the last value channelN_sampleM. Each sample should be a signed integer, right-justified to the resolution set by FLAC__stream_encoder_set_bits_per_sample(). For example, if the resolution is 16 bits per sample, the samples should all be in the range [-32768,32767].

FLAC__stream_encoder_set_apodization
FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder* encoder, char* specification)

Sets the apodization function(s) the encoder will use when windowing audio data for LPC analysis.

FLAC__stream_encoder_set_bits_per_sample
FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder* encoder, uint value)

Set the sample resolution of the input to be encoded.

FLAC__stream_encoder_set_blocksize
FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder* encoder, uint value)

Set the blocksize to use while encoding.

FLAC__stream_encoder_set_channels
FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder* encoder, uint value)

Set the number of channels to be encoded.

FLAC__stream_encoder_set_compression_level
FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder* encoder, uint value)

Set the compression level

FLAC__stream_encoder_set_do_escape_coding
FLAC__bool FLAC__stream_encoder_set_do_escape_coding(FLAC__StreamEncoder* encoder, FLAC__bool value)

Deprecated. Setting this value has no effect.

FLAC__stream_encoder_set_do_exhaustive_model_search
FLAC__bool FLAC__stream_encoder_set_do_exhaustive_model_search(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set to \c false to let the encoder estimate the best model order based on the residual signal energy, or \c true to force the encoder to evaluate all order models and select the best.

FLAC__stream_encoder_set_do_mid_side_stereo
FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set to \c true to enable mid-side encoding on stereo input. The number of channels must be 2 for this to have any effect. Set to \c false to use only independent channel coding.

FLAC__stream_encoder_set_do_qlp_coeff_prec_search
FLAC__bool FLAC__stream_encoder_set_do_qlp_coeff_prec_search(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set to \c false to use only the specified quantized linear predictor coefficient precision, or \c true to search neighboring precision values and use the best one.

FLAC__stream_encoder_set_loose_mid_side_stereo
FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set to \c true to enable adaptive switching between mid-side and left-right encoding on stereo input. Set to \c false to use exhaustive searching. Setting this to \c true requires FLAC__stream_encoder_set_do_mid_side_stereo() to also be set to \c true in order to have any effect.

FLAC__stream_encoder_set_max_lpc_order
FLAC__bool FLAC__stream_encoder_set_max_lpc_order(FLAC__StreamEncoder* encoder, uint value)

Set the maximum LPC order, or \c 0 to use only the fixed predictors.

FLAC__stream_encoder_set_max_residual_partition_order
FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder* encoder, uint value)

Set the maximum partition order to search when coding the residual. This is used in tandem with FLAC__stream_encoder_set_min_residual_partition_order().

FLAC__stream_encoder_set_metadata
FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder* encoder, FLAC__StreamMetadata** metadata, uint num_blocks)

Set the metadata blocks to be emitted to the stream before encoding. A value of \c NULL, \c 0 implies no metadata; otherwise, supply an array of pointers to metadata blocks. The array is non-const since the encoder may need to change the \a is_last flag inside them, and in some cases update seek point offsets. Otherwise, the encoder will not modify or free the blocks. It is up to the caller to free the metadata blocks after encoding finishes.

FLAC__stream_encoder_set_min_residual_partition_order
FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder* encoder, uint value)

Set the minimum partition order to search when coding the residual. This is used in tandem with FLAC__stream_encoder_set_max_residual_partition_order().

FLAC__stream_encoder_set_ogg_serial_number
FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder* encoder, long serial_number)

Set the serial number for the FLAC stream to use in the Ogg container.

FLAC__stream_encoder_set_qlp_coeff_precision
FLAC__bool FLAC__stream_encoder_set_qlp_coeff_precision(FLAC__StreamEncoder* encoder, uint value)

Set the precision, in bits, of the quantized linear predictor coefficients, or \c 0 to let the encoder select it based on the blocksize.

FLAC__stream_encoder_set_rice_parameter_search_dist
FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder* encoder, uint value)

Deprecated. Setting this value has no effect.

FLAC__stream_encoder_set_sample_rate
FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder* encoder, uint value)

Set the sample rate (in Hz) of the input to be encoded.

FLAC__stream_encoder_set_streamable_subset
FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set the <A HREF="../format.html#subset">Subset</A> flag. If \c true, the encoder will comply with the Subset and will check the settings during FLAC__stream_encoder_init_*() to see if all settings comply. If \c false, the settings may take advantage of the full range that the format allows.

FLAC__stream_encoder_set_total_samples_estimate
FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder* encoder, FLAC__uint64 value)

Set an estimate of the total samples that will be encoded. This is merely an estimate and may be set to \c 0 if unknown. This value will be written to the STREAMINFO block before encoding, and can remove the need for the caller to rewrite the value later if the value is known before encoding.

FLAC__stream_encoder_set_verify
FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder* encoder, FLAC__bool value)

Set the "verify" flag. If \c true, the encoder will verify it's own encoded output by feeding it through an internal decoder and comparing the original signal against the decoded signal. If a mismatch occurs, the process call will return \c false. Note that this will slow the encoding process by the extra time required for decoding and comparison.

Static variables

FLAC__StreamEncoderInitStatusString
char** FLAC__StreamEncoderInitStatusString;

Maps a FLAC__StreamEncoderInitStatus to a C string.

FLAC__StreamEncoderReadStatusString
char** FLAC__StreamEncoderReadStatusString;

Maps a FLAC__StreamEncoderReadStatus to a C string.

FLAC__StreamEncoderSeekStatusString
char** FLAC__StreamEncoderSeekStatusString;

Maps a FLAC__StreamEncoderSeekStatus to a C string.

FLAC__StreamEncoderStateString
char** FLAC__StreamEncoderStateString;

Maps a FLAC__StreamEncoderState to a C string.

FLAC__StreamEncoderTellStatusString
char** FLAC__StreamEncoderTellStatusString;

Maps a FLAC__StreamEncoderTellStatus to a C string.

FLAC__StreamEncoderWriteStatusString
char** FLAC__StreamEncoderWriteStatusString;

Maps a FLAC__StreamEncoderWriteStatus to a C string.

Structs

FLAC__StreamEncoder
struct FLAC__StreamEncoder

The opaque structure definition for the stream encoder type. See the \link flac_stream_encoder stream encoder module \endlink for a detailed description.

FLAC__StreamEncoderPrivate
struct FLAC__StreamEncoderPrivate
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
FLAC__StreamEncoderProtected
struct FLAC__StreamEncoderProtected

class FLAC__StreamEncoder

Meta