Class Recorder

Definition

Namespace:
Tizen.Multimedia
Assembly:
Tizen.Multimedia.Recorder.dll
API Level:
3

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.

C#
Copy
public abstract class Recorder : IDisposable
Inheritance
Recorder
Derived

Properties

View Source

AudioBitRate

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

Declaration
C#
Copy
public int AudioBitRate { get; set; }
Property Value
Type Description
Int32
Remarks

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

API Level: 4
View Source

AudioChannels

Gets or sets the number of the audio channel.

Declaration
C#
Copy
public int AudioChannels { get; set; }
Property Value
Type Description
Int32

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.

API Level: 4
View Source

AudioCodec

Gets the audio codec for encoding an audio stream.

Declaration
C#
Copy
public RecorderAudioCodec AudioCodec { get; }
Property Value
Type Description
RecorderAudioCodec
API Level: 4
View Source

AudioDevice

Gets or sets the audio device for recording.

Declaration
C#
Copy
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.

API Level: 4
View Source

AudioSampleRate

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

Declaration
C#
Copy
public int AudioSampleRate { get; set; }
Property Value
Type Description
Int32
Remarks

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

API Level: 4
View Source

FileFormat

Gets the file format of the recording result.

Declaration
C#
Copy
public RecorderFileFormat FileFormat { get; }
Property Value
Type Description
RecorderFileFormat
API Level: 4
View Source

Muted

Gets or sets the mute state of a recorder.

Declaration
C#
Copy
public bool Muted { get; set; }
Property Value
Type Description
Boolean
API Level: 4
View Source

SizeLimit

Gets or sets the maximum size of a recording file.

Declaration
C#
Copy
public int SizeLimit { get; set; }
Property Value
Type Description
Int32

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.

API Level: 4
View Source

State

Gets the current state of the recorder.

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

A RecorderState that specifies the state of the recorder.

API Level: 3
View Source

TimeLimit

Gets or sets the time limit of recording.

Declaration
C#
Copy
public int TimeLimit { get; set; }
Property Value
Type Description
Int32

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.

API Level: 4

Methods

View Source

ApplyAudioStreamPolicy(AudioStreamPolicy)

Apply the audio stream policy.

Declaration
C#
Copy
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.

API Level: 4
View Source

Cancel()

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

Declaration
C#
Copy
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.

API Level: 3
View Source

Commit()

Stops recording and saves the result.

Declaration
C#
Copy
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.

API Level: 3
View Source

Dispose()

Releases the unmanaged resources used by the Recorder.

Declaration
C#
Copy
public void Dispose()
API Level: 3
View Source

Dispose(Boolean)

Releases the resources used by the Recorder.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

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

API Level: 3
View Source

GetDeviceState(RecorderType)

Returns the state of recorder device.

Declaration
C#
Copy
public static RecorderDeviceState GetDeviceState(RecorderType type)
Parameters
Type Name Description
RecorderType type
Returns
Type Description
RecorderDeviceState
API Level: 4
View Source

GetPeakAudioLevel()

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

Declaration
C#
Copy
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.

API Level: 4
View Source

GetSupportedAudioCodecs()

Gets the audio encoders that the current device supports.

Declaration
C#
Copy
public static IEnumerable<RecorderAudioCodec> GetSupportedAudioCodecs()
Returns
Type Description
IEnumerable<RecorderAudioCodec>
API Level: 4
Feature: http://tizen.org/feature/media.audio_recording
View Source

GetSupportedFileFormats()

Gets the file formats that the current device supports.

Declaration
C#
Copy
public static IEnumerable<RecorderFileFormat> GetSupportedFileFormats()
Returns
Type Description
IEnumerable<RecorderFileFormat>
API Level: 4
Feature: http://tizen.org/feature/media.audio_recording
View Source

Pause()

Pauses the recording.

Declaration
C#
Copy
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.

API Level: 3
View Source

Prepare()

Prepares the media recorder for recording.

Declaration
C#
Copy
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.

API Level: 3
View Source

Resume()

Resumes the recording.

Declaration
C#
Copy
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.

API Level: 4
View Source

Start(String)

Starts the recording.

Declaration
C#
Copy
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.

See Also
API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/recorder
View Source

Unprepare()

Resets the media recorder.

Declaration
C#
Copy
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.

API Level: 3

Events

View Source

AudioStreamStoring

Occurs when the audio stream data is being delivered.

Declaration
C#
Copy
public event EventHandler<AudioStreamStoringEventArgs> AudioStreamStoring
Event Type
Type Description
EventHandler<AudioStreamStoringEventArgs>
Remarks

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

API Level: 4
View Source

DeviceStateChanged

Occurs when a recorder device state changes.

Declaration
C#
Copy
public static event EventHandler<RecorderDeviceStateChangedEventArgs> DeviceStateChanged
Event Type
Type Description
EventHandler<RecorderDeviceStateChangedEventArgs>
API Level: 4
View Source

ErrorOccurred

Occurs when an error occurs during the recorder operation.

Declaration
C#
Copy
public event EventHandler<RecordingErrorOccurredEventArgs> ErrorOccurred
Event Type
Type Description
EventHandler<RecordingErrorOccurredEventArgs>
API Level: 3
View Source

Interrupted

Occurs after interrupt handling is completed.

Declaration
C#
Copy
public event EventHandler<RecorderInterruptedEventArgs> Interrupted
Event Type
Type Description
EventHandler<RecorderInterruptedEventArgs>
API Level: 3
View Source

Interrupting

Occurs before interrupt handling is started.

Declaration
C#
Copy
public event EventHandler<RecorderInterruptingEventArgs> Interrupting
Event Type
Type Description
EventHandler<RecorderInterruptingEventArgs>
API Level: 4
View Source

MuxedStreamDelivered

Occurs when the muxed stream data is being delivered.

Declaration
C#
Copy
public event EventHandler<MuxedStreamDeliveredEventArgs> MuxedStreamDelivered
Event Type
Type Description
EventHandler<MuxedStreamDeliveredEventArgs>
API Level: 3
View Source

RecordingLimitReached

Occurs when recording limit is reached.

Declaration
C#
Copy
public event EventHandler<RecordingLimitReachedEventArgs> RecordingLimitReached
Event Type
Type Description
EventHandler<RecordingLimitReachedEventArgs>
Remarks

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

API Level: 3
View Source

RecordingStatusChanged

Occurs when the recording information changes.

Declaration
C#
Copy
public event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged
Event Type
Type Description
EventHandler<RecordingStatusChangedEventArgs>
API Level: 4
View Source

StateChanged

This event occurs when the recorder state is changed.

Declaration
C#
Copy
public event EventHandler<RecorderStateChangedEventArgs> StateChanged
Event Type
Type Description
EventHandler<RecorderStateChangedEventArgs>
API Level: 3

Extension Methods