AppRecordingManager.RecordTimeSpanToFileAsync Method

Definition

Writes audio and video content of the current app from the historical buffer, with a time range defined by the specified start time and duration, to the specified destination file.

public:
 virtual IAsyncOperation<AppRecordingResult ^> ^ RecordTimeSpanToFileAsync(DateTime startTime, TimeSpan duration, StorageFile ^ file) = RecordTimeSpanToFileAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<AppRecordingResult> RecordTimeSpanToFileAsync(DateTime const& startTime, TimeSpan const& duration, StorageFile const& file);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<AppRecordingResult> RecordTimeSpanToFileAsync(System.DateTimeOffset startTime, System.TimeSpan duration, StorageFile file);
function recordTimeSpanToFileAsync(startTime, duration, file)
Public Function RecordTimeSpanToFileAsync (startTime As DateTimeOffset, duration As TimeSpan, file As StorageFile) As IAsyncOperation(Of AppRecordingResult)

Parameters

startTime
DateTime DateTimeOffset

The time at which the content to be recorded started. This value must be within the duration of the historical buffer, which can be determined by calling AppRecordingManager.GetStatus and then checking the value of the AppRecordingStatus.HistoricalBufferDuration property.

duration
TimeSpan TimeSpan

The requested duration of the app recording. An app recording can succeed, but record a shorter duration than specified with this parameter if the allocated storage for recordings is reached. To determine the duration of the file that was actually recorded, check the value AppRecordingResult.Duration property of the object returned from this operation.

file
StorageFile

The file to which the recorded media is written.

Returns

An asynchronous operation that returns an AppRecordingResult object upon completion, which contains information about the status of the recording operation.

Attributes

Remarks

The stored file containing the app recording is created as an MP4 with h.264 video and AAC audio. Video files recorded using AppRecordingManager are not ingested into first-party experiences like GameDVR or the XBox app.

Before calling this method, call GetStatus and check the value of the CanRecordTimeSpan to determine if the current app is currently able to make a time span recording.

Use StartRecordingToFileAsync to begin an app recording at the current time.

Applies to