Copyright © 2005-2023 MultiMedia Soft

How to retrieve basic TAG information from the sound loaded into a player

Previous pageReturn to chapter overviewNext page

This tutorial refers to a set of methods which, although still of some usage, are now mostly superseded by methods described inside the How to read TAG information in sound files tutorial.

 

Many formats add some information, also known as Tags, to the song binary in order to allow an immediate identification of the file contents: the availability of this information and its contents can be retrieved using the following methods:

 

IsTagAvailable determines if a certain type of tag is contained inside the song binary

GetFileTagField retrieves a specific field inside the tag

GetTagString retrieves a string inside the tag

 

Note that, in order to speed up the sound file loading, tag information is not available immediately after the call of the LoadSound method: once the sound is loaded, you can force the control to read tag information using the SoundInfoGet method.

 

If the GetFileTagField method succeeds in retrieving the artist name and the title of the song, you can try requesting the related lyrics text through the SoundLyricsRequest method: this request will try to connect to the MultiMedia Soft server in order to check for availability of the requested lyrics text: when the request has been completed and after the CallbackForPlayersEvents delegate has been invoked with the nEvent parameter set to EV_LYRICS_AVAIL with a positive result, you can retrieve the lyrics text through the SoundLyricsGet method.

 

In a similar way, after having obtained information about the artist name and the title of the album, there is the possibility to obtain the cover art of the related Audio CD (see the How to get Audio CD info using CDDB servers tutorial for details).

 

 

If dealing with playlists, you can use the PlayListGetItemString method in order to receive a string containing the needed information.

 

 

 

A sample of access to tag information in Visual C# and Visual Basic.NET can be found inside the following sample installed with the product's setup package:

- SoundInfo