Results 1 to 2 of 2

Thread: How to create a MetadataExtract object?

  1. #1
    Newbie
    Join Date
    Nov 2016
    Location
    Mexico
    Posts
    1

    Question How to create a MetadataExtract object?

    Hi,

    In Android, I've been trying to extract metadata from an MP3 audio file using a Metadata Extractor object. But I've been failing on create the metadataExtractorObj. This is my following code:

    Code :
     
        SLresult result;
        // Creating engine
        result = slCreateEngine(&engineObject, 0, NULL, 0, NULL, NULL);
        assert(SL_RESULT_SUCCESS == result);
        (void)result;
     
        result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
        assert(SL_RESULT_SUCCESS == result);
        (void)result;
     
        result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine);
        assert(SL_RESULT_SUCCESS == result);
        (void)result;
     
        // Creating URI with protocol file://
        SLDataLocator_URI loc_uri = {SL_DATALOCATOR_URI, (SLchar * ) uri};
        SLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, (SLchar * )"audio/mpeg3", SL_CONTAINERTYPE_MP3};
        SLDataSource audioSrc = {&loc_uri, &format_mime};
     
        // Creating URI with protocol
        SLObjectItf metadataExtactCreatorObj = NULL;
        const SLInterfaceID ids[1] = {SL_IID_METADATAEXTRACTION};
        const SLboolean req[1] = {SL_BOOLEAN_FALSE};
    //    const SLInterfaceID ids[] = {};
    //    const SLboolean req[] = {};
     
        result = (*engineEngine)->CreateMetadataExtractor(engineEngine
                ,&metadataExtactCreatorObj 
                ,&audioSrc
                ,1
                ,ids
                ,req);
     
    //    assert(SL_RESULT_SUCCESS == result);
    //    (void)result;
        if (SL_RESULT_FEATURE_UNSUPPORTED == result) // <----- The result is always Feature Unsupported
        {
            return;
        }
     
        result = (*metadataExtactCreatorObj)->Realize(metadataExtactCreatorObj, SL_BOOLEAN_FALSE);
        assert(SL_RESULT_SUCCESS == result);
        (void)result;
     
        SLMetadataExtractionItf metadataExtractionItf;
        result = (*metadataExtactCreatorObj)->GetInterface(metadataExtactCreatorObj, SL_IID_METADATAEXTRACTION, &metadataExtractionItf);
        assert(SL_RESULT_SUCCESS == result);
        (void)result;

    The result that I always get from CreateMetadataExtractor is SL_RESULT_FEATURE_UNSUPPORTED. What am I missing for this to be SL_RESULT_SUCCESS?

    Thanks you, have a nice day.

  2. #2
    Super Moderator
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    64
    Hi Chaq686,

    If you are getting the result code SL_RESULT_FEATURE_UNSUPPORTED, that means that the implementation does not support CreateMetadataExtractor(). The problem isn't in your code, it's the lack of support for metadata by the implementation.

    Best,

    Erik
    Erik Noreke,
    Working Group Chair OpenSL ES, OpenMAX AL and Safety Critical

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean