locked
[UWP]What are possible samplerates when creating AudioEncodingProperties for AAC encoding in AudioGraph RRS feed

  • Question

  • I am using an AudioGraph to record form a microphone to a file. I want to use the AAC encoding because of wide availability. The quality is less important than the file size. I want to choose 16Khz samplerate, 1 channel, and a bitdepth of 16. When creating a AudioFileOutputNode, I get the error that the format is not supported. Which formats are supported and which are the smallest?AAC supports this according to the specifications, but appearantly W10/Audiograph doesn't.
    Friday, March 1, 2019 4:37 PM

Answers

  • Hello,

    As far as I know, AudioGraph is a wrapper of Media Foundation. So, you could refer to documentation pages for MF's AAC encoder.

    Tuesday, March 5, 2019 8:54 AM
  • Hi Ronald,

    FEC-4RP is correct. The AudioGraph uses Media Foundation under the covers. There are very specific limitations when using the AAC encoder. You can check out the link already provided by FEC-4RP to understand what these limitations are: https://docs.microsoft.com/en-us/windows/desktop/medfound/aac-encoder

    For reference:

    Samples per second.
        44100 (44.1 KHz)
        48000 (48 KHz)

    Number of channels.     
        Must be 1 (mono) or 2 (stereo), or 6 (5.1).

    Bit rate of the encoded AAC stream, in bytes per second.
        12000
        16000
        20000
        24000
    The default value for both mono and stereo is 12000 (96 Kbps).


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, March 5, 2019 8:18 PM

All replies

  • Hi,

    As the document File output node mentioned, "File output nodes support the following file formats: mp3, wav, wma, m4a.". So you could choose one of them for your goals. 

    As I know, WAV is uncompressed format and files in this format are bigger than other file. WMA is Microsoft's own proprietary format and it doesn't have the same wide availability as other formats. Same to W4A about availability.  So my suggestion is to use MP3 as the format is very similar to AAC.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 4, 2019 8:50 AM
  • According to https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/supported-codecs , mp3 encoding is less supported on the different platforms than aac. So I'd rather stick to aac and find the smallest supported samplerate/channelcount/bitdepth.
    Tuesday, March 5, 2019 7:44 AM
  • Hello,

    As far as I know, AudioGraph is a wrapper of Media Foundation. So, you could refer to documentation pages for MF's AAC encoder.

    Tuesday, March 5, 2019 8:54 AM
  • How do you create encoding profile? There is a method CreateM4a(AudioEncodingQuality) in MediaEncodingProfile and that method accepts only predefined AudioEncodingQuality

    Tuesday, March 5, 2019 10:41 AM
  • Hi Ronald,

    FEC-4RP is correct. The AudioGraph uses Media Foundation under the covers. There are very specific limitations when using the AAC encoder. You can check out the link already provided by FEC-4RP to understand what these limitations are: https://docs.microsoft.com/en-us/windows/desktop/medfound/aac-encoder

    For reference:

    Samples per second.
        44100 (44.1 KHz)
        48000 (48 KHz)

    Number of channels.     
        Must be 1 (mono) or 2 (stereo), or 6 (5.1).

    Bit rate of the encoded AAC stream, in bytes per second.
        12000
        16000
        20000
        24000
    The default value for both mono and stereo is 12000 (96 Kbps).


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, March 5, 2019 8:18 PM
  • UAIU,

    This is a question that is only tangentially related to the original post. To help us keep things clean can you please start another post with this question? If you mention me in the post our forum team will alert me and I can jump in and help out.

    Thanks,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, March 5, 2019 8:20 PM