The basic usage of this decoder is as follows:
The file decoder is a trivial wrapper around the seekable stream decoder meant to simplfy the process of decoding from a standard file. The file decoder supplies all but the Write/Metadata/Error callbacks. The user needs only to provide the path to the file and the file decoder handles the rest.
Like the seekable stream decoder, seeking is exposed through the FLAC__file_decoder_seek_absolute() method. At any point after the file decoder has been initialized, the user can call this function to seek to an exact sample within the file. Subsequently, the first time the write callback is called it will be passed a (possibly partial) block starting at that sample.
The file decoder also inherits MD5 signature checking from the seekable stream decoder. If this is turned on before initialization, FLAC__file_decoder_finish() will report when the decoded MD5 signature does not match the one stored in the STREAMINFO block. MD5 checking is automatically turned off if there is no signature in the STREAMINFO block or when a seek is attempted.
Make sure to read the detailed descriptions of the seekable stream decoder module and stream decoder module since the file decoder inherits much of its behavior from them.
true
, otherwise false
.FLAC__file_decoder_finish() resets all settings to the constructor defaults, including the callbacks.
|
Signature for the write callback. See FLAC__file_decoder_set_write_callback() and FLAC__SeekableStreamDecoderWriteCallback for more info.
|
|
Signature for the metadata callback. See FLAC__file_decoder_set_metadata_callback() and FLAC__SeekableStreamDecoderMetadataCallback for more info.
|
|
Signature for the error callback. See FLAC__file_decoder_set_error_callback() and FLAC__SeekableStreamDecoderErrorCallback for more info.
|
|
State values for a FLAC__FileDecoder The decoder's state can be obtained by calling FLAC__file_decoder_get_state().
|
|
Create a new file decoder instance. The instance is created with default settings; see the individual FLAC__file_decoder_set_*() functions for each setting's default.
|
|
Free a decoder instance. Deletes the object pointed to by decoder.
|
|
Set the "MD5 signature checking" flag. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_md5_checking().
|
|
Set the input file name to decode.
|
|
Set the write callback. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_write_callback().
|
|
Set the metadata callback. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_callback().
|
|
Set the error callback. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_error_callback().
|
|
Set the client data to be passed back to callbacks. This value will be supplied to callbacks in their client_data argument.
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_respond().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_respond_application().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_respond_all().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_ignore().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_ignore_application().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_set_metadata_ignore_all().
|
|
Get the current decoder state.
|
|
Get the state of the underlying seekable stream decoder. Useful when the file decoder state is
|
|
Get the state of the underlying stream decoder. Useful when the file decoder state is
|
|
Get the current decoder state as a C string. This version automatically resolves
|
|
Get the "MD5 signature checking" flag. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_md5_checking().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_channels().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_channel_assignment().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_bits_per_sample().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_sample_rate().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_blocksize().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_get_decode_position().
|
|
Initialize the decoder instance. Should be called after FLAC__file_decoder_new() and FLAC__file_decoder_set_*() but before any of the FLAC__file_decoder_process_*() functions. Will set and return the decoder state, which will be FLAC__FILE_DECODER_OK if initialization succeeded.
|
|
Finish the decoding process. Flushes the decoding buffer, releases resources, resets the decoder settings to their defaults, and returns the decoder state to FLAC__FILE_DECODER_UNINITIALIZED. In the event of a prematurely-terminated decode, it is not strictly necessary to call this immediately before FLAC__file_decoder_delete() but it is good practice to match every FLAC__file_decoder_init() with a FLAC__file_decoder_finish().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_process_single().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_process_until_end_of_metadata().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_process_until_end_of_stream().
|
|
This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_skip_single_frame().
|
|
Flush the input and seek to an absolute sample. This is inherited from FLAC__SeekableStreamDecoder; see FLAC__seekable_stream_decoder_seek_absolute().
|
|
Maps a FLAC__FileDecoderState to a C string. Using a FLAC__FileDecoderState as the index to this array will give the string equivalent. The contents should not be modified. |