使用Media Foundation从未压缩的IEEE浮点音频编码到AAC

Encoding from Uncompressed IEEE floating-point audio to AAC using Media Foundation

本文关键字:音频 编码 AAC IEEE Foundation Media 未压缩 使用      更新时间:2023-10-16

我一直在尝试使用Media Foundation编码未压缩的IEEE浮点音频(MFAudioFormat_Float)到AAC(MFAudioFormat_AAC),但似乎AAC编码器只能采用未压缩的PCM音频(MFAudioFormat_PCM)作为输入- AAC编码器。

当我使用MFTEnum或MFTEnumEx函数时:

hr = MFTEnum(
    MFT_CATEGORY_AUDIO_ENCODER,
    NULL,                                 // Reserved
    &tininfo /* MFAudioFormat_Float */,   // Input type to match.
    &toutinfo /* MFAudioFormat_AAC */,    // Output type to match.
    NULL,                                 // Attributes to match. (None.)
    &pCLSIDs,                             // Receives a pointer to an array of CLSIDs.
    &count                                // Receives the size of the array.
    );

它找不到任何可用的编解码器(count == 0)。

那么是否有可能使用Media Foundation来做到这一点呢?我能找到一些其他编解码器并安装和使用吗?或者也许有其他方法可以做到,而我做错了什么?

https://learn.microsoft.com/en-us/windows/win32/medfound/aac-encoder

输入类型
MF_MT_SUBTYPE                   Subtype.            Must be MFAudioFormat_PCM.
MF_MT_AUDIO_BITS_PER_SAMPLE     Bits per sample.    Must be 16.
MF_MT_AUDIO_SAMPLES_PER_SECOND  Samples per second. The following values are supported: 44100 (44.1 KHz) 48000 (48 KHz)