WinRT has audio / video capture APIs, in Windows.Media.Capture. You do not need to go to DirectX. The following C # code records a video with sound and saves it in the Video folder of the current user.
var settings = new MediaCaptureInitializationSettings(); settings.StreamingCaptureMode = StreamingCaptureMode.AudioAndVideo; var capture = new MediaCapture(); await capture.InitializeAsync(settings); var profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto); var file = await KnownFolders.VideosLibrary.CreateFileAsync("captured.mp4", CreationCollisionOption.GenerateUniqueName); await capture.StartRecordToStorageFileAsync(profile, file);
To capture audio only, use StreamingCaptureMode.Audio and MediaEncodingProfile.CreateM4a()
source share