audio_mixer_device

device
audio_mixer_device<public> := class<concrete><final>(creative_device_base)

Used to manage sound buses via control bus mixes set on the Audio Mixer Device.

Module
/Fortnite.com/Devices
Source
fortnite

Used in

class StealthAudioScript is functional_game_script()

    # We need a reference to the Audio Mixer device.
    # In the editor, you'll link this to the Audio Mixer you placed.
    audio_mixer_device: audio_mixer_device = audio_mixer_device{}

    # We also need a Timer to simulate the "Prep Phase" ending.
    # Link this to a Timer device in the editor.
    timer_device: timer_device = timer_device{}

    # This function runs when the game starts.
    # It's like the "Battle Bus" dropping off players.
    OnBegin<override>()<suspends>: void = 
        # First, let's make sure the footsteps are MUTED.
        # We do this by activating the mix we set up in the editor (Volume 0.0).
        # Since we unchecked "Activate on Game Start" in the editor, 
        # we have to call this manually to set the initial state.
        audio_mixer_device.ActivateMix()
        
        # Print a message to the debug console so we know it worked.
        Print("Stealth Mode ON: Footsteps are muted!")

    # This function is called when the Timer finishes.
    # Link the Timer's "On Finish" event to this function in the editor,
    # OR we can handle it in code if we started the timer ourselves.
    # For this example, let's assume we start the timer in OnBegin.
    
    StartTimer<override>()<suspends>: void = 
        # Start the timer for 10 seconds (the "Stealth Phase").
        timer_device.Start(10.0)
        
        # Wait for the timer to finish.
        # <suspends> means this code pauses here until the timer ends.
        timer_device.OnFinish()
        
        # NOW, the stealth phase is over.
        # Let's UNMUTE the footsteps.
        
        # NOTE: In the editor, you'd need a SECOND Audio Mixer device 
        # set to Volume 1.0 (Unmuted) and link it to a variable like
@editable
    TriggerVolume : trigger_device = trigger_device{}

    # This is the Audio Mixer device.
    # Drag your Audio Mixer device into this slot in the editor.
    @editable
    AudioMixer : audio_mixer_device = audio_mixer_device{}
    # note: audio_mixer_device manages sound buses via control bus mixes.
    # Use ActivateMix/DeactivateMix to switch between mix presets configured
    # in the editor. Volume changes must be wired via the Audio Mixer device's
    # mix settings in the editor (e.g., set the mix to reduce music bus volume).

    # This runs once when the game starts.
JoustingGame / Jousting Team Controller verse-source
TeamAudioMixer : audio_mixer_device = audio_mixer_device{}

    @editable
    BaseAudioMixer : audio_mixer_device = audio_mixer_device{}

    @editable
    TeamIntroVideoCinematic : cinematic_sequence_device = cinematic_sequence_device{}
AudioSystem / Audio Zone Module verse-source
audio_zone_base<public> := class<abstract>:
        Logger: log = log{Channel := log_audio, DefaultLevel := log_level.Normal}
        @editable 
        var OutdoorMix<public> : audio_mixer_device = audio_mixer_device{}

        @editable 
        IndoorMix<public> : audio_mixer_device = audio_mixer_device{}

        @editable 
        ZoneVolume<public> : mutator_zone_device = mutator_zone_device{}

        @editable 
        IsInTown<public> : logic = false

        @editable 
        IsInCity<public> : logic = false

        @editable 
        var CityRegion<public> : CityRegionOptions = CityRegionOptions.None

        var RegisteredPlayers<public> : []player = array{}

        SubscribeToZoneEvents()<suspends>:void =
            ZoneVolume.AgentEntersEvent.Subscribe(OnPlayerEnter)
            ZoneVolume.AgentExitsEvent.Subscribe(OnPlayerExit)

        OnPlayerEnter(Agent : agent) : void =
            if (Player := player[Agent]):
                RegisterPlayer(Player)

        OnPlayerExit(Agent : agent) : void =
            if (Player := player[Agent]):
                UnregisterPlayer(Player)

        RegisterPlayer(Player : player) : void =
            if (RegisteredPlayers.Find[Player] = false):
                set RegisteredPlayers += array{Player}
                OutdoorMix.Unregister(Player)
                IndoorMix.Register(Player)
                UpdateAudioZoneManager(Player)
Modules / Audio Zone Module verse-source
audio_zone_base<public> := class<abstract>:
        Logger: log = log{Channel := Verse.Scripts.AudioSystem.log_audiozones, DefaultLevel := log_level.Normal}
        @editable 
        var OutdoorMix<public> : audio_mixer_device = audio_mixer_device{}

        @editable 
        IndoorMix<public> : audio_mixer_device = audio_mixer_device{}

        @editable 
        ZoneVolume<public> : mutator_zone_device = mutator_zone_device{}

        @editable 
        IsInTown<public> : logic = false

        @editable 
        IsInCity<public> : logic = false

        @editable 
        var CityRegion<public> : CityRegionOptions = CityRegionOptions.None

        var RegisteredPlayers<public> : []player = array{}

        SubscribeToZoneEvents()<suspends>:void =
            ZoneVolume.AgentEntersEvent.Subscribe(OnPlayerEnter)
            ZoneVolume.AgentExitsEvent.Subscribe(OnPlayerExit)

        OnPlayerEnter(Agent : agent) : void =
            if (Player := player[Agent]):
                RegisterPlayer(Player)

        OnPlayerExit(Agent : agent) : void =
            if (Player := player[Agent]):
                UnregisterPlayer(Player)

        RegisterPlayer(Player : player) : void =
            if (RegisteredPlayers.Find[Player] = false):
                set RegisteredPlayers += array{Player}
                OutdoorMix.Unregister(Player)
                IndoorMix.Register(Player)
                UpdateAudioZoneManager(Player)
DatalayerSystem / Zone Assets List verse-source
asset_list<public>:= class:
    #@editable
    CreativeObjects : []creative_object_type = array{
        creative_object_type{object:=audio_mixer_device},
        creative_object_type{object:=audio_player_device},
        creative_object_type{object:=barrier_device},
        creative_object_type{object:=billboard_device},
        creative_object_type{object:=chair_device},
        creative_object_type{object:=creative_prop},
        creative_object_type{object:=creative_object}
    }
DatalayerSystem / Datalayers Module verse-source
ActorTags := for (TaggedIndex -> TaggedActor : TaggedActors):
                if (AudioMixerDevice := audio_mixer_device[TaggedActor]):
                    if (DebugMode?) then if (DebugMode?) then Logger.Print("{DataLayerName} - Audio Mixed Device Found, Playing")
                    # If the tagged actor is an Audio Mixed device, play it
                    AudioMixerDevice.ActivateMix()
                else if (AudioPlayerDevice := audio_player_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Audio Device Found, Playing")
                    # If the tagged actor is an Audio device, play it
                    AudioPlayerDevice.Enable()
                    AudioPlayerDevice.Play()
                else if (BarrierDevice := barrier_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Tagged Barrier Device Found, Enabling")
                    # If the tagged actor is a Barrier device, turn it on (this is separate from the barriers in the DataLayer meant to keep players out)
                    BarrierDevice.Enable()
                else if (ButtonDevice := button_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Tagged Barrier Device Found, Enabling")
                    ButtonDevice.Enable()
                else if (BillboardDevice := billboard_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Billboard Device Found, Enabling")
                    # If the tagged actor is a Billboard device, enable it
                    BillboardDevice.ShowText()
                else if (ChairDevice := chair_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Chair Device Found, Enabling")
                    ChairDevice.Enable()
                else if (CreativeProp := creative_prop[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Creative Prop Found, Showing")
                    CreativeProp.Show()
                else if (CustomDevice := creative_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Custom Creative Device Found, Showing")
                    # If the tagged actor is a custom creative device, hide it
                    CustomDevice.Show()
                else if (DamageVolume := damage_volume_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Damage Volume Device Found, Enabling")
                    DamageVolume.Enable()
                else if (FuelPumpDevice := fuel_pump_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Fuel Pump Device Found, Enabling")
                    # If the tagged actor is a Fuel Pump device, enable it
                    FuelPumpDevice.Enable()
                else if (LightDevice := customizable_light_device[TaggedActor]):
                    if (DebugMode?) then Logger.Print("{DataLayerName} - Customizable Light Device Found, Turning On")