locked
WASAPI: record real stereo RRS feed

  • Question

  • Hi,

    When using WASAPI to record audio from the phone's microphones, then the resulting output contains two channels, but the content of each channel is the same (in other words it's just mirrored mono audio but no real stereo). This is true for phones with 2 microphones as well.

    To initialize WASAPI I use this:

    WAVEFORMATEX format;
    format.wFormatTag = WAVE_FORMAT_PCM;
    format.nChannels = 2;
    format.nSamplesPerSec = 44100;
    format.wBitsPerSample = 16;
    format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8);
    format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
    format.cbSize = 0;
    
    m_wasapiAudioDevice->Initialize(AUDCLNT_SHAREMODE_SHARED, 0x88000000, 1024 * 10000, 0, format, NULL);

    How can I get real stereo audio output?

    Regards,

    Monday, December 9, 2013 6:20 AM

Answers

  • Yes, the functionality you are looking for would have to be addressed at the driver level. If each microphone appears as a separate input device then you could theoretically multiplex the audio from each device into a single wave file.

    -James


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

    • Marked as answer by SyFr Saturday, December 14, 2013 5:34 AM
    Saturday, December 14, 2013 1:18 AM
  • Hello,

    Most phones only have a single microphone. Because of this you will not be able to get stereo audio from them. The microphone array the phone uses is up to the phone manufacturer and is not something that we specify. The phone's driver duplicates the audio to allow for pseudo stereo recording.

    I hope this helps,

    James


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

    Monday, December 9, 2013 11:56 PM

All replies

  • I'll ask our media guru to respond.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, December 9, 2013 4:00 PM
  • Hello,

    Most phones only have a single microphone. Because of this you will not be able to get stereo audio from them. The microphone array the phone uses is up to the phone manufacturer and is not something that we specify. The phone's driver duplicates the audio to allow for pseudo stereo recording.

    I hope this helps,

    James


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

    Monday, December 9, 2013 11:56 PM
  • So, on a device with 2 microphones (such as the Lumia 1020) it's a driver problem which can only be fixed by an update by the manufacturer (e.g. Nokia)?
    Tuesday, December 10, 2013 6:21 AM
  • Yes, the functionality you are looking for would have to be addressed at the driver level. If each microphone appears as a separate input device then you could theoretically multiplex the audio from each device into a single wave file.

    -James


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

    • Marked as answer by SyFr Saturday, December 14, 2013 5:34 AM
    Saturday, December 14, 2013 1:18 AM