Class Recorder

    Definition

    Namespace:
    Tizen.Multimedia
    Assembly:
    Tizen.Multimedia.Recorder.dll

    Recorder is a base class for audio and video recorders that provides the ability to control the recording of a multimedia content.

    Simple audio and audio/video are supported.

    public abstract class Recorder : IDisposable
    Inheritance
    object
    Recorder
    Derived
    AudioRecorder
    AudioRecorder
    VideoRecorder
    VideoRecorder
    Implements
    System.IDisposable

    Properties

    View Source

    AudioBitRate

    Gets or sets the bitrate of an audio encoder in bits per second.

    Declaration
    public int AudioBitRate { get; set; }
    Property Value
    Type Description
    int
    Remarks

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than or equal to zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    AudioChannels

    Gets or sets the number of the audio channel.

    Declaration
    public int AudioChannels { get; set; }
    Property Value
    Type Description
    int

    For mono recording, set the channel to 1. For stereo recording, set the channel to 2.

    Remarks

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than or equal to zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    AudioCodec

    Gets the audio codec for encoding an audio stream.

    Declaration
    public RecorderAudioCodec AudioCodec { get; }
    Property Value
    Type Description
    RecorderAudioCodec
    See Also
    GetSupportedAudioCodecs()
    View Source

    AudioDevice

    Gets or sets the audio device for recording.

    Declaration
    public RecorderAudioDevice AudioDevice { get; set; }
    Property Value
    Type Description
    RecorderAudioDevice

    A RecorderAudioDevice that specifies the type of the audio device.

    Remarks

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentException

    value is not valid.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    AudioSampleRate

    Gets or sets the sampling rate of an audio stream in hertz.

    Declaration
    public int AudioSampleRate { get; set; }
    Property Value
    Type Description
    int
    Remarks

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than or equal to zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    FileFormat

    Gets the file format of the recording result.

    Declaration
    public RecorderFileFormat FileFormat { get; }
    Property Value
    Type Description
    RecorderFileFormat
    See Also
    GetSupportedFileFormats()
    View Source

    Muted

    Gets or sets the mute state of a recorder.

    Declaration
    public bool Muted { get; set; }
    Property Value
    Type Description
    bool
    Exceptions
    Type Condition
    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    SizeLimit

    Gets or sets the maximum size of a recording file.

    Declaration
    public int SizeLimit { get; set; }
    Property Value
    Type Description
    int

    The maximum size of a recording file in kilobytes, or 0 for unlimited size.

    Remarks

    After reaching the limitation, the data which is being recorded will be discarded and will not be written to the file.

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    State

    Gets the current state of the recorder.

    Declaration
    public RecorderState State { get; }
    Property Value
    Type Description
    RecorderState

    A RecorderState that specifies the state of the recorder.

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    TimeLimit

    Gets or sets the time limit of recording.

    Declaration
    public int TimeLimit { get; set; }
    Property Value
    Type Description
    int

    The time of recording in seconds, or 0 for unlimited time.

    Remarks

    After reaching the limitation, the data which is being recorded will be discarded and will not be written to the file.

    To set, the recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    value is less than zero.

    System.InvalidOperationException

    The recorder is not in the valid state.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    Methods

    View Source

    ApplyAudioStreamPolicy(AudioStreamPolicy)

    Apply the audio stream policy.

    Declaration
    public void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
    Parameters
    Type Name Description
    AudioStreamPolicy policy

    The policy to apply.

    Remarks

    The recorder must be in the Idle or the Ready state.

    Exceptions
    Type Condition
    System.ArgumentNullException

    policy is null.

    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    policy is not supported for the recorder.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.
    -or-
    policy already has been disposed of.

    View Source

    Cancel()

    Cancels the recording.
    The recording data is discarded and not written in the recording file.

    Declaration
    public void Cancel()
    Remarks

    The recorder must be in the Recording or the Paused state. The state of the recorder will be the Ready after the operation.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    The method is called in AudioStreamStoring event.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    Commit()

    Stops recording and saves the result.

    Declaration
    public void Commit()
    Remarks

    The recorder must be in the Recording or the Paused state. The state of the recorder will be the Ready after the operation.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    The method is called in AudioStreamStoring event.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    Dispose()

    Releases the unmanaged resources used by the Recorder.

    Declaration
    public void Dispose()
    View Source

    Dispose(bool)

    Releases the resources used by the Recorder.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    View Source

    GetDeviceState(RecorderType)

    Returns the state of recorder device.

    Declaration
    public static RecorderDeviceState GetDeviceState(RecorderType type)
    Parameters
    Type Name Description
    RecorderType type
    Returns
    Type Description
    RecorderDeviceState
    Exceptions
    Type Condition
    System.ArgumentException

    type is invalid.

    View Source

    GetPeakAudioLevel()

    Returns the peak audio input level in dB since the last call to this method.

    Declaration
    public double GetPeakAudioLevel()
    Returns
    Type Description
    double
    Remarks

    0dB indicates the maximum input level, -300dB indicates the minimum input level.

    The recorder must be in the Recording or the Paused state.

    Exceptions
    Type Condition
    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    GetSupportedAudioCodecs()

    Gets the audio encoders that the current device supports.

    Declaration
    public static IEnumerable<RecorderAudioCodec> GetSupportedAudioCodecs()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><RecorderAudioCodec>
    Exceptions
    Type Condition
    System.NotSupportedException

    A required feature is not supported.

    View Source

    GetSupportedFileFormats()

    Gets the file formats that the current device supports.

    Declaration
    public static IEnumerable<RecorderFileFormat> GetSupportedFileFormats()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T><RecorderFileFormat>
    Exceptions
    Type Condition
    System.NotSupportedException

    A required feature is not supported.

    View Source

    Pause()

    Pauses the recording.

    Declaration
    public void Pause()
    Remarks

    The recorder should be in the Recording state. The state of the recorder will be the Paused after this. It has no effect if the current state is the Paused.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    Prepare()

    Prepares the media recorder for recording.

    Declaration
    public void Prepare()
    Remarks

    The recorder should be in the Idle state. The state of the recorder will be the Ready after this. It has no effect if the current state is the Ready.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    Resume()

    Resumes the recording.

    Declaration
    public void Resume()
    Remarks

    The recorder should be in the Paused state. The state of recorder will be the Recording after this. It has no effect if the current state is the Recording.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    View Source

    Start(string)

    Starts the recording.

    Declaration
    public void Start(string savePath)
    Parameters
    Type Name Description
    string savePath

    The file path for recording result.

    Remarks

    The recorder must be in the Ready state. The state of the recorder will be the Recording after this.

    If the specified path exists, the file is removed automatically and updated by new one.
    The mediastorage privilege(http://tizen.org/privilege/mediastorage) is required if the path is relevant to media storage.
    The externalstorage privilege(http://tizen.org/privilege/externalstorage) is required if the path is relevant to external storage.

    In the video recorder, some preview format does not support record mode. You should use the default preview format or the Nv12 in the record mode.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    The preview format of the camera is not supported.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    System.ArgumentNullException

    savePath is null.

    System.ArgumentException

    savePath is a zero-length string, contains only white space.

    System.UnauthorizedAccessException

    Caller does not have required privilege.

    See Also
    Commit()
    Cancel()
    View Source

    Unprepare()

    Resets the media recorder.

    Declaration
    public void Unprepare()
    Remarks

    The recorder should be in the Ready state. The state of recorder will be the Idle after this. It has no effect if the current state is the Idle.

    Exceptions
    Type Condition
    System.InvalidOperationException

    The recorder is not in the valid state.
    -or-
    An internal error occurred.

    System.ObjectDisposedException

    The recorder already has been disposed of.

    Events

    View Source

    AudioStreamStoring

    Occurs when the audio stream data is being delivered.

    Declaration
    public event EventHandler<AudioStreamStoringEventArgs> AudioStreamStoring
    Event Type
    Type Description
    System.EventHandler<TEventArgs><AudioStreamStoringEventArgs>
    Remarks

    Do not call Commit() and Cancel() in this event.

    View Source

    DeviceStateChanged

    Occurs when a recorder device state changes.

    Declaration
    public static event EventHandler<RecorderDeviceStateChangedEventArgs> DeviceStateChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecorderDeviceStateChangedEventArgs>
    View Source

    ErrorOccurred

    Occurs when an error occurs during the recorder operation.

    Declaration
    public event EventHandler<RecordingErrorOccurredEventArgs> ErrorOccurred
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecordingErrorOccurredEventArgs>
    View Source

    Interrupted

    Occurs after interrupt handling is completed.

    Declaration
    public event EventHandler<RecorderInterruptedEventArgs> Interrupted
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecorderInterruptedEventArgs>
    View Source

    Interrupting

    Occurs before interrupt handling is started.

    Declaration
    public event EventHandler<RecorderInterruptingEventArgs> Interrupting
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecorderInterruptingEventArgs>
    View Source

    MuxedStreamDelivered

    Occurs when the muxed stream data is being delivered.

    Declaration
    public event EventHandler<MuxedStreamDeliveredEventArgs> MuxedStreamDelivered
    Event Type
    Type Description
    System.EventHandler<TEventArgs><MuxedStreamDeliveredEventArgs>
    View Source

    RecordingLimitReached

    Occurs when recording limit is reached.

    Declaration
    public event EventHandler<RecordingLimitReachedEventArgs> RecordingLimitReached
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecordingLimitReachedEventArgs>
    Remarks

    After this event is raised, the recording data is discarded and not written in the recording file.

    View Source

    RecordingStatusChanged

    Occurs when the recording information changes.

    Declaration
    public event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecordingStatusChangedEventArgs>
    View Source

    StateChanged

    This event occurs when the recorder state is changed.

    Declaration
    public event EventHandler<RecorderStateChangedEventArgs> StateChanged
    Event Type
    Type Description
    System.EventHandler<TEventArgs><RecorderStateChangedEventArgs>

    Implements

    System.IDisposable
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX