BASS.NET API for the Un4seen BASS Audio LibraryBassTagsBASS_TAG_GetFromFile Method (String, Boolean, Boolean)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the requested tags/headers from a file, if they are available.

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

public static TAG_INFO BASS_TAG_GetFromFile(
	string file,
	bool setDefaultTitle,
	bool prescan
)

Parameters

file
Type: SystemString
The fully qualified name of the file stream to get the TAG information from.
setDefaultTitle
Type: SystemBoolean
If the title property will be set to a default value (filename without extension).
prescan
Type: SystemBoolean
If the BASS_STREAM_PRESCAN flag is used to return an exact title value - else the duration might just be good approximation, but the method will perform faster.

Return Value

Type: TAG_INFO
Returns a new TAG_INFO instance if successful. If file could not be found is returned.
Exceptions

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

Note: This method uses the BASS plug-in system and such supports all formats which are supported by BASS or any of its add-ons. So make sure to load all needed add-ons via BASS_PluginLoad(String).

This method first evaluates the file name extension. If using with a ".wma" or ".wmv" file and you are using the WMA DRM version, the WMA tags are received immediately. For all other file types an internal stream handle is created by using the plug-in system and calling BASS_StreamCreateFile(String, Int64, Int64, BASSFlag). If successful, the TAG_INFO is returned via BASS_TAG_GetFromFile(String) (see overload list). All members of the TAG_INFO structure will be updated. However, some files and tag structures might not support all members.

Examples

Getting TAGs from a file directly:
VB
Dim tagInfo As TAG_INFO = BassTags.BASS_TAG_GetFromFile(fileName, True, True)
If Not (tagInfo Is Nothing) Then
  ' display the tags...
End If
TAG_INFO tagInfo = BassTags.BASS_TAG_GetFromFile(fileName, true, true);
if ( tagInfo != null )
{
  // display the tags...
}
See Also

Reference