docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AudioInput

    Use this class to record audio from the built-in Unity audio system.

    Inheritance
    object
    RecorderInput
    AudioInput
    Implements
    IDisposable
    Inherited Members
    RecorderInput.settings
    RecorderInput.Dispose()
    RecorderInput.Dispose(bool)
    RecorderInput.SessionCreated(RecordingSession)
    RecorderInput.NewFrameStarting(RecordingSession)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    RecorderInput.BeginRecording(RecordingSession)

    EndRecording(RecordingSession)

    Declaration
    protected override void EndRecording(RecordingSession session)
    Parameters
    Type Name Description
    RecordingSession session
    Overrides
    RecorderInput.EndRecording(RecordingSession)

    FrameDone(RecordingSession)

    Declaration
    protected override void FrameDone(RecordingSession session)
    Parameters
    Type Name Description
    RecordingSession session
    Overrides
    RecorderInput.FrameDone(RecordingSession)

    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

    NewFrameReady(RecordingSession)

    Declaration
    protected override void NewFrameReady(RecordingSession session)
    Parameters
    Type Name Description
    RecordingSession session
    Overrides
    RecorderInput.NewFrameReady(RecordingSession)

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)