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.
C#Copypublic abstract class Recorder : IDisposable
- Inheritance
-
objectRecorder
- Derived
- Implements
-
System.IDisposable
Properties
Declaration
C#Copypublic int AudioBitRate { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic RecorderAudioCodec AudioCodec { get; }
Property Value
| Type | Description |
|---|---|
| RecorderAudioCodec |
See Also
Declaration
C#Copypublic RecorderAudioDevice AudioDevice { get; set; }
Property Value
| Type | Description |
|---|---|
| RecorderAudioDevice | A RecorderAudioDevice that specifies the type of the audio device. |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic int AudioSampleRate { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic RecorderFileFormat FileFormat { get; }
Property Value
| Type | Description |
|---|---|
| RecorderFileFormat |
See Also
Declaration
C#Copypublic bool Muted { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Exceptions
| Type | Condition |
|---|---|
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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 |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic 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 |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Methods
Declaration
C#Copypublic void ApplyAudioStreamPolicy(AudioStreamPolicy policy)
Parameters
| Type | Name | Description |
|---|---|---|
| AudioStreamPolicy | policy | The policy to apply. |
Remarks
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.InvalidOperationException | The recorder is not in the valid state. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Cancel()
Cancels the recording.
The recording data is discarded and not written in the recording file.
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic void Dispose()
Declaration
C#Copyprotected 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. |
Declaration
C#Copypublic static RecorderDeviceState GetDeviceState(RecorderType type)
Parameters
| Type | Name | Description |
|---|---|---|
| RecorderType | type |
Returns
| Type | Description |
|---|---|
| RecorderDeviceState |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
GetPeakAudioLevel()
Returns the peak audio input level in dB since the last call to this method.
Declaration
C#Copypublic 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. |
Declaration
C#Copypublic static IEnumerable<RecorderAudioCodec> GetSupportedAudioCodecs()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T><RecorderAudioCodec> |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | A required feature is not supported. |
Declaration
C#Copypublic static IEnumerable<RecorderFileFormat> GetSupportedFileFormats()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T><RecorderFileFormat> |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | A required feature is not supported. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
| System.ArgumentNullException |
|
| System.ArgumentException |
|
| System.UnauthorizedAccessException | Caller does not have required privilege. |
Declaration
C#Copypublic 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. |
| System.ObjectDisposedException | The recorder already has been disposed of. |
Events
Declaration
C#Copypublic event EventHandler<AudioStreamStoringEventArgs> AudioStreamStoring
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><AudioStreamStoringEventArgs> |
Remarks
Declaration
C#Copypublic static event EventHandler<RecorderDeviceStateChangedEventArgs> DeviceStateChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecorderDeviceStateChangedEventArgs> |
Declaration
C#Copypublic event EventHandler<RecordingErrorOccurredEventArgs> ErrorOccurred
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecordingErrorOccurredEventArgs> |
Declaration
C#Copypublic event EventHandler<RecorderInterruptedEventArgs> Interrupted
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecorderInterruptedEventArgs> |
Declaration
C#Copypublic event EventHandler<RecorderInterruptingEventArgs> Interrupting
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecorderInterruptingEventArgs> |
Declaration
C#Copypublic event EventHandler<MuxedStreamDeliveredEventArgs> MuxedStreamDelivered
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><MuxedStreamDeliveredEventArgs> |
Declaration
C#Copypublic 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.
Declaration
C#Copypublic event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecordingStatusChangedEventArgs> |
Declaration
C#Copypublic event EventHandler<RecorderStateChangedEventArgs> StateChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<TEventArgs><RecorderStateChangedEventArgs> |