Namespaces
Variants
Actions
Revision as of 08:17, 2 February 2012 by hamishwillee (Talk | contribs)

Audio Metadata Reader API

Jump to: navigation, search
Article Metadata

Code Example
Article
Created: ltomuta (16 Jun 2007)
Last edited: hamishwillee (02 Feb 2012)


Note.png
Note: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

Purpose

The Audio Metadata Reader API provides classes useful to get metadata information of an audio file.

Use cases

Some of the basic uses of this API are to retrieve the count of metadata fields, fields information like artist name, length of the file, year of album, etc.

Example code

Header files

#include <MetaDataFieldContainer.h>
#include <MetaDataUtility.h>
#include <MetaDataField.hrh>

Link against:

LIBRARY MetaDataUtility.lib

The classes used are CMetaDataFieldContainer and CMetaDataUtility.

_LIT(KFileName,"c:\\FileName.mp3");
 
void CTestAudioMetadataReaderAPIAppUi::ConstructL()
{
CMetaDataUtility* iMDUtility = CMetaDataUtility::NewL();
iMDUtility->OpenFileL(KFileName);
}
void CTestAudioMetadataReaderAPIAppUi::GetMetadataL()
{
//Returns the number of metadata fields.
TInt iMetaCount = iMDUtility->MetaDataCount();
 
TBuf<64> itext;
itext.AppendNum(iMetaCount);
CEikonEnv::InfoWinL(_L("METADATA COUNT:"),itext);
 
//Returns the metadata fields found in this source.
const CMetaDataFieldContainer& iMDfield = iMDUtility->MetaDataFieldsL();
TMetaDataFieldId aFieldId;
 
for(TInt i=0;i < iMetaCount;i++)
{
//Returns the field at given location, first element at position 0.
iMDfield.At(i,aFieldId);
TBuf<50> iMetaField;
iMetaField.AppendNum(aFieldId);
CEikonEnv::InfoWinL(_L("METADATA FIELD ID:"),iMetaField);
iMetaField.Zero();
 
//Returns the metadata field that corresponds to the field ID.
TPtrC iMetaData = iMDfield.Field(aFieldId);
iMetaField.Append(iMetaData);
CEikonEnv::InfoWinL(_L("METADATA FIELD:"),iMetaField);
iMetaField.Zero();
}
}

Example Application

414 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved