1.3.4.1 Library Interface
This section lists the files that are available in the FLAC Decoder Library.
Description
This section lists the files that are available in the src folder of the FLAC Decoder Library. It lists which files need to be included in the build based on a configuration option selected by the system.
The following three tables list and describe the header (.h) and source (.c) files that implement this library. The parent folder for these files is src/config/<config_dir>/audio/decoder/
Interface File(s)
This table lists and describes the header files that must be included (i.e., using #include) by any code that uses this library.
Source File Name | Description |
---|---|
audio_decoders.h | Header file that includes the lower-level include files (e.g. flac_dec.h) |
audio_decoders_config.h | Header file that contains #defines for each enabled decoder FLAC_DECODER_ENABLED) |
Required File(s)
This table lists and describes the header and source files that must always be included in the MPLAB X IDE project to build this library.
Source File Name | Description |
---|---|
audio_decoders/flac/flac_dec.c,.h | These are public APIs for using the FLAC Decoder |
audio_decoders/flac/flac_master/include/FLAC/format.h | This file configures decoding logic and format |
The FLAC Decoder Library files in the apps repository only contain a wrapper around the Xiph open-source FLAC Decoder, located in the xiph_flac repository. Files from the Harmony framework's xiph repo are copied into the local flac folder of the application when code is generated using MHC.
If using the FLAC Decoder Library from the audio repository, the xiph_flac repository must also be downloaded.1.3.4.1 Library Interface
This section describes the Application Programming Interface (API) functions of the FLAC Decoder Library, in this version of the release.
Functions
Name | Description |
---|---|
FLAC_isDecoder_enabled | Function to check if FLAC decoding is enabled. |
FLAC_Initialize | Function to initialize FLAC library. |
FLAC_RegisterDecoderEventHandlerCallback | Registers application defined Decoder Callbacks. |
FLAC_DecodeSingleFrame | This function decodes one FLAC frame and returns the decoded data. |
FLAC_GetChannels | This function returns number of channels. |
FLAC_GetBitRate | This function returns the bit rate. |
FLAC_GetSamplingRate | This function returns the sample rate. |
FLAC_GetBlockSize | This Function returns the number of samples in a sub block. |
FLAC_GetBitdepth | This function returns the resolution of the sound data. |
FLAC_GetDuration | This function returns the track length of the FLAC audio file. |
FLAC_Cleanup | This is the function for deallocating memory resources of a FLAC decoder. |
FLAC_DecoderIsFileValid | Function to check if a given FLAC file is valid or not. |
Data Types and Constants
Name | Description |
---|---|
DecoderEventHandlerCB | The Callback function template for the application defined callback Functions. |
FLAC_DEC_APPLICATIONCB_SET | The set of callbacks an application would be interested for callback. |
FLAC_DEC_WRITE_EVT_CONTINUE | Write status Success upon decoder writecallback. |
FLAC_DEC_WRITE_EVT_ERR | Write status Error upon decoder writecallback. |