BASS.NET API for the Un4seen BASS Audio Library

BassTagsBASS_TAG_GetFromURL Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the requested tags/headers from a URL stream, 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_GetFromURL(
	int stream,
	TAG_INFO tags
)

Parameters

stream
Type: SystemInt32
The stream 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.
Remarks

This method first tries to get streaming header information via BASS_TAG_ICY and BASS_TAG_HTTP. Then it tries the following tags in that order: BASS_TAG_META, BASS_TAG_OGG, BASS_TAG_APE and BASS_TAG_WMA.

This method is able to retrieve the following TAGs:

Shoutcast streamingBASS_TAG_ICY and BASS_TAG_META
Icecast streamingBASS_TAG_HTTP and BASS_TAG_OGG
WMA streamingUse BASS_TAG_GetFromFile(String) instead, since WMA URL stream are created with the file method.
APE streamingBASS_TAG_HTTP and BASS_TAG_APE

The following members of the TAG_INFO structure will be updated:
titleWith the detected new stream title, if found.

Note: The 'streamtitle' might be composed within the meta data, e.g. Shoutcast combines the artist name and the real track name together. Shoutcast titles will be split at the first occurence of a " - " seperator.

artistWith the detected new artist, if found.

Note: For Shoutcast stream this will be set as the 'streamtile' will splitted.

albumWith the detected name of the stream, if found (eg. icy-name).
genreWith the detected genre of the stream, if found (eg. icy-genre).
commentWith the detected new stream url, if found (eg. icy-url).
yearWith the detected bitrate, if found (only used with shoutcast streams, eg. icy-br).
Examples

// create a stream
int stream = BASS_StreamCreateURL(url, 0, BASSFlag.BASS_STREAM_STATUS, null, 0);
// update the tags
TAG_INFO tagInfo = new TAG_INFO(url);
if ( BassTags.BASS_TAG_GetFromURL( stream, tagInfo) )
{
  // display the tags...
}
See Also

Reference