Open ID3Tag Library




Intro


Project : Open ID3Tag Library

Language : Standard C++

License : LGPL

Source : https://bitbucket.org/und3rs/open-id3tag-library/src/master/

Support Version : ID3v11, ID3v2, ID3v2.2, ID3v2.3, ID3v2.4

Support Info : All Frame ID (see http://id3.org/)

support Unicode.

Comment : Extract ID3Tag information from the Media File.

Include:  test program(ID3C.exe), Source Code



Usage



    [How to use]


MetadataInfo::ID3::ID3Tag id3Tag;
	
	// open media file
	if (id3Tag.Open("C:\media.mp3") == true) {

		// check if the title information exist.
		if (id3Tag.ContainsInfo(MetadataInfo::ID3::TITLE) == true) {
			// get the title information value in string type.
			wcout << "Title: " << id3Tag.GetStringValue(MetadataInfo::ID3::TITLE) << endl;
		}

		// empty string is returned, if the information not exist.
		wcout << "Band: " << id3Tag.GetStringValue(MetadataInfo::ID3::BAND) << endl;
		
		// you can use the string type frame id.
		wcout << "Year: " << id3Tag.GetStringValue(L"YEAR") << endl;

		// use the GetBinaryValue method for extract binary frame data.
		long frameDataSize = id3Tag.GetBinarySize(MetadataInfo::ID3::COVER_IMAGE);
		char * buffer = (char *)malloc(frameDataSize);
		id3Tag.GetBinaryValue(MetadataInfo::ID3::COVER_IMAGE, buffer, frameDataSize);

		// please read the ID3 Spec(http://id3.org) for treat binary value data.

		// for extract image data in the file....
		long imageDataSize = 0;
		const char * imageData = id3Tag.GetBinaryImage(buffer, frameDataSize, imageDataSize);

		ofstream SaveFile(L"CoverImage.jpg", ios_base::out | ios_base::binary);
		SaveFile.write(imageData, imageDataSize);
		SaveFile.close();
	}

	// release resources
	id3Tag.Close();





사용법은 코드를 참고하시면 됩니다. :)




ID3C.exe (TestProgram)


C:\>id3c.exe media.mp3