Source Audio File for AAC Using Windows Media Foundation in Windows 7

Thanks for taking the time to read my question.

I am developing a C ++ application using Qt and the Windows API.

I am recording the microphone output into small 10s audio files in raw format and I want to convert them to aac format.

I tried to read as many things as possible and thought it would be nice to start with the Windows Media Transcoding API.

The problem is that I cannot use the .raw or .pcm file in the "CreateObjectFromUrl" function, and therefore I am pretty much stuck here at the moment. He continues to fail. The hr return code is 3222091460. I tried to pass the .mp3 file to a function, and of course it works, so there is no connection with url-human-failure.

MF_OBJECT_TYPE ObjectType = MF_OBJECT_INVALID;

IMFSourceResolver* pSourceResolver = NULL;
IUnknown* pUnkSource = NULL;

// Create the source resolver.
hr = MFCreateSourceResolver(&pSourceResolver);
if (FAILED(hr))
{
    qDebug() << "Failed !";
}


// Use the source resolver to create the media source.


 hr = pSourceResolver->CreateObjectFromURL(
        sURL,                       // URL of the source.
        MF_RESOLUTION_MEDIASOURCE,  // Create a source object.
        NULL,                       // Optional property store.
        &ObjectType,                // Receives the created object type.
        &pUnkSource                 // Receives a pointer to the media source.
        );

MFCreateSourceResolver , CreateObjectFromURL : (

, :

  • aac Windows media?
  • , , , ?

, ffmpeg libav, , GPL. Windows Media aac, .

, , , , , , , . ( , )

+5
1

hr 3222091460

HRESULT . "ShowHresult" , . 0xC00D36C4 MF_E_UNSUPPORTED_BYTESTREAM_TYPE " URL ."

, .WAV - - , .

AAC Media Foundation AAC Encoder IMFTransform. , AAC , . raw .AAC.

Media Foundation - DirectShow ( , , ), libfaac, FFmpeg libavcodec ( LGPL, GPL).

+3

All Articles