logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AudioChannelCreator

    Creates a Serenity audio channel — a UnityAudioPlayerSettings asset routed to a mixer group — from validated input. Thin adapter over AudioPlayerSettingsCreator, which owns every asset mutation (resolve-or-create by Id, rollback, Addressables registration); kept as a separate entry point purely so the Relationship Manager's Create Channel section (Validate(string, string)'s string-per-call shape, DefaultChannelOutputFolder) does not have to change.

    Inheritance
    object
    AudioChannelCreator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.SoundMixer.Infrastructure.RelationshipManager.Editor
    Assembly: Serenity.UnitySoundMixer.Infrastructure.Editor.dll
    Syntax
    public static class AudioChannelCreator

    Fields

    DefaultChannelOutputFolder

    Folder a new channel's UnityAudioPlayerSettings asset is created under when the caller does not pick one of its own — the same folder AudioPlayerSettingsCreator defaults new channels to.

    Declaration
    public const string DefaultChannelOutputFolder = "Assets/Game/Media/Audio/Channels"
    Field Value
    Type Description
    string

    Methods

    Create(string, string, AudioPlayerType, uint, AudioMixerGroup, bool)

    Resolves-or-creates a channel settings asset named after id in folderPath, routed to group. An id already used by a channel in that same folder is edited in place, not duplicated — see AudioPlayerSettingsCreator's type doc for why this replaced the old unique-name-on-clash path. registerAsAddressables defaults to true (the real gap the old path left open); a test opts out to avoid polluting the project's Addressables settings.

    Declaration
    public static AudioChannelCreator.Result Create(string folderPath, string id, AudioPlayerType type, uint channels, AudioMixerGroup group, bool registerAsAddressables = true)
    Parameters
    Type Name Description
    string folderPath
    string id
    AudioPlayerType type
    uint channels
    AudioMixerGroup group
    bool registerAsAddressables
    Returns
    Type Description
    AudioChannelCreator.Result

    Validate(string, string)

    Validates the channel parameters (id format, folder). Delegates entirely to Validate(Input) — the single source of truth for what makes a channel Id/folder valid — rather than keeping a second, independently-maintained rule set that can drift from it. Returns the first reported error, or null when valid.

    Semantic change versus the old hand-rolled check: the destination folder no longer has to already exist. AudioPlayerSettingsCreator creates a missing folder during Create(string, string, AudioPlayerType, uint, AudioMixerGroup, bool) (via SettingsAssetAuthoring.EnsureProjectFolderExists), so requiring it to pre-exist here was only ever a stricter-than-necessary leftover from the old direct AssetDatabase.CreateAsset path. A folder outside 'Assets' (or empty) is still rejected.

    Declaration
    public static string Validate(string folderPath, string id)
    Parameters
    Type Name Description
    string folderPath
    string id
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved