BASS.NET API for the Un4seen BASS Audio Library

BassTagsBASS_TAG_GetFromFile Method (Int32, TAG_INFO)

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the requested tags/headers from a stream channel, if they are available.

Namespace:  Un4seen.Bass.AddOn.Tags
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public static bool BASS_TAG_GetFromFile(
	int stream,
	TAG_INFO tags
)

Parameters

stream
Type: SystemInt32
The stream channel to get the TAG information from.
tags
Type: Un4seen.Bass.AddOn.TagsTAG_INFO
The TAG_INFO class where to put the data.

Return Value

Type: Boolean
If TAGs could be retrieved successfully is returned, else is returned.
Exceptions

ExceptionCondition
NotSupportedExceptionInvalid/Unsupported tag version detected.
FormatExceptionInvalid syncsafe integer found in tag data.
Remarks

This method first evaluates the BASS_CTYPE_xxx for the stream, by calling the BASS_ChannelGetInfo(Int32, BASS_CHANNELINFO) function internally. Based on the retrieved BASSChannelType a call to the BASS_ChannelGetTags(Int32, BASSTag) function is made in order to retrieve the pointer to the tags/header data - if available. Finally this tag pointer is evaluated and the related tag/header data is evaluated.

This method is able to retrieve the following TAGs:

MP3, MP2, MP1BASS_TAG_ID3V2 first, then BASS_TAG_ID3, then BASS_TAG_APE, then BASS_TAG_RIFF_BEXT.
OGG, FLAC, OPUSBASS_TAG_OGG first, then BASS_TAG_APE
WAV, BWFBASS_TAG_RIFF_INFO first, then BASS_TAG_RIFF_BEXT.
MFBASS_TAG_MF.
WMABASS_TAG_WMA
MP4, AAC, ALACBASS_TAG_MP4 first, then BASS_TAG_ID3V2, then BASS_TAG_APE
APE, MPC, OFR, WVBASS_TAG_APE first, then BASS_TAG_ID3V2, then BASS_TAG_ID3
WINAMPBASS_TAG_ID3V2 first, then BASS_TAG_APE
SPX, AC3not available
MODMOD music name and message are evaluated only.
All members of the TAG_INFO structure will be updated. However, some files and tag structures might not support all members.

The following TAGs are combined in the following order (if multiple TAGs are found):

BASS_TAG_ID3V2BASS_TAG_ID3 + BASS_TAG_APE + BASS_TAG_ID3V2
BASS_TAG_ID3BASS_TAG_APE + BASS_TAG_ID3
BASS_TAG_WMABASS_TAG_WMA
BASS_TAG_OGGBASS_TAG_APE + BASS_TAG_OGG
BASS_TAG_APEBASS_TAG_ID3 + BASS_TAG_APE
BASS_TAG_MP4BASS_TAG_APE + BASS_TAG_ID3V2 + BASS_TAG_MP4
BASS_TAG_RIFF_INFOBASS_TAG_RIFF_BEXT + BASS_TAG_RIFF_CART + BASS_TAG_ID3V2 + BASS_TAG_RIFF_INFO

Examples

// create a stream
int stream = Bass.BASS_StreamCreateFile(fileName, 0, 0, BASSFlag.BASS_DEFAULT);
// update the tags
TAG_INFO tagInfo = new TAG_INFO(fileName);
if ( BassTags.BASS_TAG_GetFromFile( stream, tagInfo) )
{
  // display the tags...
}
See Also

Reference