Compartir a través de


IRecorder.RecordAsync Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Starts recording asynchronously.

Remarks

If an error occurs during asynchronous operation of the RecordAsync method, information about the error is returned in the RecordCompletedEventArgs object. To access this information, developers must write a procedure that extracts the information from the eventargs object and assign this procedure to the method's RecordCompleted event handler. The RecordCompletedEventArgs class derives from AsyncCompletedEventArgs and inherits an Error property that contains any error information.

The RecordAsync method raises two event types:

  • RecordStarted.This event is raised when the recorder begins to record. If an error condition prevents the recording process from starting, this event is not raised.

  • RecordCompleted.This event is raised when the recording completes. Properties of the RecordCompletedEventArgs indicate the status of the recording operation.

Developers cannot depend on the RecordStarted event to occur unconditionally. To obtain the duration of the recording, do not attempt to calculate the time difference between the RecordStarted and the RecordCompleted events; instead use the RecordingDuration property of the RecordCompletedEventArgs.

Overload List

Name Description
IRecorder.RecordAsync (String)
Starts recording asynchronously to the specified file.
IRecorder.RecordAsync (String, FileMode)
Starts recording asynchronously to the specified file using the specified file mode.

See Also

Reference

IRecorder Interface
IRecorder Members
Microsoft.SpeechServer Namespace