Retrieves the tags from a WMA file.

char *BASS_WMA_GetTags(
    char *file,
    DWORD flags


fileThe filename.
flagsA combination of these flags.
BASS_TAG_WMA_CODECGet codec information rather than tags.
BASS_UNICODEfile is a Unicode (UTF-16) filename.

Return value

If successful, the tags are returned, else NULL is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_WMAThe Windows Media modules (v9 or above) are not installed.
BASS_ERROR_FILEOPENThe file could not be opened, or it is not a WMA file.
BASS_ERROR_UNKNOWNSome other mystery problem!


This function gives the same tags as BASS_ChannelGetTags (with BASS_TAG_WMA or BASS_TAG_WMA_CODEC), which is a pointer to a series of null-terminated UTF-8 strings, the final string ending with a double null. Unlike BASS_ChannelGetTags, this function can also be used with DRM-protected WMA files without a DRM licence, as it does not require a stream to be created.

The memory used for the tags is reused by all calls of this function, so if the tags need to be retained across multiple calls, a copy should be made. It also means that this function is not thread-safe, that is it should not be called simultaneously from multiple threads.


List a WMA file's tags.
char *tags=BASS_WMA_GetTags("a.wma", 0); // get the tags
if (tags)
    while (*tags) {
        printf("%s\n",tags); // display the tag
        tags+=strlen(tags)+1; // move on to next tag

See also