Recording Audio / Video in the Windows 8 Metro App

I am working on capturing audio / video from a webcam and this is aimed at Windows 8 Metro Style Not on Desktop. I plan to write a library for this. So that any application can use this library for streaming video. Windows 8 provides Direct X and Win RT for metro mode in Windows 8. I'm a little confused which one can be used for this. Is Win RT Alone sufficient to detect a camera and capture audio / video? Is Direct X intervention required here?

+4
source share
2 answers

I found out about this on the Internet. Win RT Alone is enough for this.

http://code.msdn.microsoft.com/Media-Capture-Sample-adf87622 .

+2
source

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()

+1
source

Source: https://habr.com/ru/post/1379116/


All Articles