Answered by:
Audio capture and processing

Question
-
My task is capturing audio data from microphone and process uncompressed PCM data on fly. Can I do this using WinRT? (I also asuming that DirectSound is not available in Windows 8)
Thanks.
- Edited by Daemonolog Friday, April 20, 2012 12:02 PM
Friday, April 20, 2012 12:00 PM
Answers
-
Hello,
Yes, You can MediaCapture class in WinRT to capture the audio.
http://msdn.microsoft.com/library/windows/apps/BR241124Here a sample code about this class, and I hope you can follow it.
http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Friday, April 27, 2012 7:14 AM
Monday, April 23, 2012 2:25 AM -
Hello Daemonolog,
Here are two additional options for you:
1) Use WASAPI to capture the raw audio data. This option will have the lowest latency (preferred)
2) Create a custom Media Sink that can plug into the Media Foundation Media Engine or Media Capture element.
Either approach will work as expected and give you complete access to the underlying uncompressed PCM audio data. Both of these methods require that you use C++ Cx (MoCOM). It is highly recommended that you not process raw audio or video data in a managed environment due to issues with nondeterministic finalization.
How do I create a lossless MediaEncodingProfile?
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e39ab371-ccaf-49f9-a5d8-49a24598dc5eWin32 and COM for Metro style apps (multimedia)
http://msdn.microsoft.com/en-us/library/windows/apps/hh452756.aspxReal-time communication sample
http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290Calling the Format SDK, DirectShow, Media Foundation or the WASAPI from managed code (C#, VB.net)
http://blogs.msdn.com/b/mediasdkstuff/archive/2009/04/01/calling-the-format-sdk-directshow-media-foundation-or-the-wasapi-from-managed-code-c-vb-net.aspxI hope this helps,
James
Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
- Marked as answer by James Dailey - MSFTMicrosoft employee, Moderator Thursday, May 3, 2012 10:54 PM
Thursday, May 3, 2012 10:53 PMModerator
All replies
-
Hello,
Yes, You can MediaCapture class in WinRT to capture the audio.
http://msdn.microsoft.com/library/windows/apps/BR241124Here a sample code about this class, and I hope you can follow it.
http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622Best regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked as answer by Jesse Jiang Friday, April 27, 2012 7:14 AM
Monday, April 23, 2012 2:25 AM -
Hello Daemonolog,
Here are two additional options for you:
1) Use WASAPI to capture the raw audio data. This option will have the lowest latency (preferred)
2) Create a custom Media Sink that can plug into the Media Foundation Media Engine or Media Capture element.
Either approach will work as expected and give you complete access to the underlying uncompressed PCM audio data. Both of these methods require that you use C++ Cx (MoCOM). It is highly recommended that you not process raw audio or video data in a managed environment due to issues with nondeterministic finalization.
How do I create a lossless MediaEncodingProfile?
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e39ab371-ccaf-49f9-a5d8-49a24598dc5eWin32 and COM for Metro style apps (multimedia)
http://msdn.microsoft.com/en-us/library/windows/apps/hh452756.aspxReal-time communication sample
http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290Calling the Format SDK, DirectShow, Media Foundation or the WASAPI from managed code (C#, VB.net)
http://blogs.msdn.com/b/mediasdkstuff/archive/2009/04/01/calling-the-format-sdk-directshow-media-foundation-or-the-wasapi-from-managed-code-c-vb-net.aspxI hope this helps,
James
Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
- Marked as answer by James Dailey - MSFTMicrosoft employee, Moderator Thursday, May 3, 2012 10:54 PM
Thursday, May 3, 2012 10:53 PMModerator