Class AudioInput
Use this class to record audio from the built-in Unity audio system.
Implements
Inherited Members
Namespace: UnityEditor.Recorder.Input
Assembly: Unity.Recorder.Editor.dll
Syntax
public class AudioInput : RecorderInput, IDisposable
Properties
AudioSettings
The settings of the audio input.
Declaration
public AudioInputSettings AudioSettings { get; }
Property Value
| Type | Description |
|---|---|
| AudioInputSettings |
ChannelCount
The number of channels in the audio input.
Declaration
public ushort ChannelCount { get; }
Property Value
| Type | Description |
|---|---|
| ushort |
SampleRate
The sampling rate, in hertz.
Declaration
public int SampleRate { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
BeginRecording(RecordingSession)
Declaration
protected override void BeginRecording(RecordingSession session)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordingSession | session |
Overrides
EndRecording(RecordingSession)
Declaration
protected override void EndRecording(RecordingSession session)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordingSession | session |
Overrides
FrameDone(RecordingSession)
Declaration
protected override void FrameDone(RecordingSession session)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordingSession | session |
Overrides
GetBuffer(ref NativeArray<float>, out int)
Get the buffer of audio samples.
Declaration
public void GetBuffer(ref NativeArray<float> userArray, out int writtenSize)
Parameters
| Type | Name | Description |
|---|---|---|
| NativeArray<float> | userArray | A native array of float that is supplied and managed by the user. |
| int | writtenSize | The number of values that were written to the supplied array. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Throws an exception if the passed array is too small to hold the buffer data. |
GetBufferSize()
Get the size of the buffer of audio samples (including all channels).
Declaration
public int GetBufferSize()
Returns
| Type | Description |
|---|---|
| int | The size of the buffer. |
NewFrameReady(RecordingSession)
Declaration
protected override void NewFrameReady(RecordingSession session)
Parameters
| Type | Name | Description |
|---|---|---|
| RecordingSession | session |