简体   繁体   中英

Windows Runtime API: MediaCapture how to limit recording file size

With Windows.Media.Capture.MediaCapture, can we specify a size limit so that this event(RecordLimitationExceededEventHandler) is fired and recording is stopped?

If not, what is the proper way to monitor file size.

Thanks!

From MSDN :

If an app receives a RecordLimitationExceeded event, it is expected to finalize the file it is recording. If it does not finalize, the capture engine will stop sending samples to the file that the app was recording to.

In Windows 8, the current record limit is three hours.

So the platform will raise this event for you.

If you're interested in limiting the file size, there's a good sample on the FileSystemWatcher MSDN page for how to monitor changes to a file. Look for the Changed event, and examine the ChangeType argument.

You don't raise this event, is the OS the one raising it, you only need to handle it to stop recording.

If you want to monitor the file size you can use a FileSystemWatcher for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM