FLAC  1.3.3
Free Lossless Audio Codec
Modules | Functions
FLAC/metadata.h: metadata level 0 interface

Modules

 

Functions

FLAC__bool FLAC__metadata_get_streaminfo (const char *filename, FLAC__StreamMetadata *streaminfo)
 
FLAC__bool FLAC__metadata_get_tags (const char *filename, FLAC__StreamMetadata **tags)
 
FLAC__bool FLAC__metadata_get_cuesheet (const char *filename, FLAC__StreamMetadata **cuesheet)
 
FLAC__bool FLAC__metadata_get_picture (const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, uint32_t max_width, uint32_t max_height, uint32_t max_depth, uint32_t max_colors)
 

Detailed Description

The level 0 interface consists of individual routines to read the STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring only a filename.

They try to skip any ID3v2 tag at the head of the file.

Function Documentation

◆ FLAC__metadata_get_streaminfo()

FLAC__bool FLAC__metadata_get_streaminfo ( const char *  filename,
FLAC__StreamMetadata streaminfo 
)

Read the STREAMINFO metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters
filenameThe path to the FLAC file to read.
streaminfoA pointer to space for the STREAMINFO block. Since FLAC__StreamMetadata is a simple structure with no memory allocation involved, you pass the address of an existing structure. It need not be initialized.
Assertions:\n
filename != NULL
streaminfo != NULL
Return values
FLAC__booltrue if a valid STREAMINFO block was read from filename. Returns false if there was a memory allocation error, a file decoder error, or the file contained no STREAMINFO block. (A memory allocation error is possible because this function must set up a file decoder.)

◆ FLAC__metadata_get_tags()

FLAC__bool FLAC__metadata_get_tags ( const char *  filename,
FLAC__StreamMetadata **  tags 
)

Read the VORBIS_COMMENT metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters
filenameThe path to the FLAC file to read.
tagsThe address where the returned pointer will be stored. The tags object must be deleted by the caller using FLAC__metadata_object_delete().
Assertions:\n
filename != NULL
tags != NULL
Return values
FLAC__booltrue if a valid VORBIS_COMMENT block was read from filename, and *tags will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no VORBIS_COMMENT block, and *tags will be set to NULL.

◆ FLAC__metadata_get_cuesheet()

FLAC__bool FLAC__metadata_get_cuesheet ( const char *  filename,
FLAC__StreamMetadata **  cuesheet 
)

Read the CUESHEET metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file.

Parameters
filenameThe path to the FLAC file to read.
cuesheetThe address where the returned pointer will be stored. The cuesheet object must be deleted by the caller using FLAC__metadata_object_delete().
Assertions:\n
filename != NULL
cuesheet != NULL
Return values
FLAC__booltrue if a valid CUESHEET block was read from filename, and *cuesheet will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no CUESHEET block, and *cuesheet will be set to NULL.

◆ FLAC__metadata_get_picture()

FLAC__bool FLAC__metadata_get_picture ( const char *  filename,
FLAC__StreamMetadata **  picture,
FLAC__StreamMetadata_Picture_Type  type,
const char *  mime_type,
const FLAC__byte *  description,
uint32_t  max_width,
uint32_t  max_height,
uint32_t  max_depth,
uint32_t  max_colors 
)

Read a PICTURE metadata block of the given FLAC file. This function will try to skip any ID3v2 tag at the head of the file. Since there can be more than one PICTURE block in a file, this function takes a number of parameters that act as constraints to the search. The PICTURE block with the largest area matching all the constraints will be returned, or *picture will be set to NULL if there was no such block.

Parameters
filenameThe path to the FLAC file to read.
pictureThe address where the returned pointer will be stored. The picture object must be deleted by the caller using FLAC__metadata_object_delete().
typeThe desired picture type. Use -1 to mean "any type".
mime_typeThe desired MIME type, e.g. "image/jpeg". The string will be matched exactly. Use NULL to mean "any MIME type".
descriptionThe desired description. The string will be matched exactly. Use NULL to mean "any description".
max_widthThe maximum width in pixels desired. Use (uint32_t)(-1) to mean "any width".
max_heightThe maximum height in pixels desired. Use (uint32_t)(-1) to mean "any height".
max_depthThe maximum color depth in bits-per-pixel desired. Use (uint32_t)(-1) to mean "any depth".
max_colorsThe maximum number of colors desired. Use (uint32_t)(-1) to mean "any number of colors".
Assertions:\n
filename != NULL
picture != NULL
Return values
FLAC__booltrue if a valid PICTURE block was read from filename, and *picture will be set to the address of the metadata structure. Returns false if there was a memory allocation error, a file decoder error, or the file contained no PICTURE block, and *picture will be set to NULL.