docs.unity3d.com
    Show / Hide Table of Contents

    Struct ChannelEnumConverter

    Utility class for converting between AudioSpeakerMode, SoundFormat, and channel count

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Audio
    Syntax
    public struct ChannelEnumConverter

    Methods

    GetChannelCountFromSoundFormat(SoundFormat)

    Get the channel count for a SoundFormat

    Declaration
    public static int GetChannelCountFromSoundFormat(SoundFormat format)
    Parameters
    Type Name Description
    SoundFormat format

    The sound format whose channel count is desired

    Returns
    Type Description
    Int32

    The number of channels for the provided format

    Exceptions
    Type Condition
    ArgumentException

    Thrown when format is invalid or unknown

    GetSoundFormatFromSpeakerMode(AudioSpeakerMode)

    Convert an AudioSpeakerMode to a SoundFormat

    Declaration
    public static SoundFormat GetSoundFormatFromSpeakerMode(AudioSpeakerMode mode)
    Parameters
    Type Name Description
    AudioSpeakerMode mode

    The speaker mode to convert

    Returns
    Type Description
    SoundFormat

    The equivalent sound format

    Exceptions
    Type Condition
    ArgumentException

    Thrown when mode is invalid or unknown"

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023