ActivateMix

method
ActivateMix<public>(): void

Activates the mix set on the audio mixer.

Module
/Fortnite.com/Devices
Declared in
audio_mixer_device
Source
fortnite

Used in

# 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,
# 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.
    OnBegin<override>()<suspends> : void =
        # Connect the trigger to our function.
        # When someone enters, run 'OnPlayerEnter'.
        TriggerVolume.TriggeredEvent.Subscribe(OnPlayerEnter)

    # This function runs when a player enters the trigger.
    # trigger_device events pass an optional agent, so we accept ?agent.
    OnPlayerEnter(Agent : ?agent) : void =
        # Activate the mix configured on the Audio Mixer device.
        # Set up your mix in the editor to lower the Music bus volume to ~20%.
        AudioMixer.ActivateMix()
        # note: To control a separate Effects bus, add a second
        # @editable audio_mixer_device for your effects mix and
        # call ActivateMix on that reference instead.
AudioSystem / Audio Zone Module verse-source
case (Time):
                time_of_day_enum.Day =>
                    OutdoorMixNight.DeactivateMix()
                    OutdoorMixDay.ActivateMix()
                    set OutdoorMix = OutdoorMixDay
                time_of_day_enum.Night =>
                    OutdoorMixDay.DeactivateMix()
                    OutdoorMixNight.ActivateMix()
                    set OutdoorMix = OutdoorMixNight
Modules / Audio Zone Module verse-source
case (Time):
                time_of_day_enum.Day =>
                    OutdoorMixNight.DeactivateMix()
                    OutdoorMixDay.ActivateMix()
                    set OutdoorMix = OutdoorMixDay
                time_of_day_enum.Night =>
                    OutdoorMixDay.DeactivateMix()
                    OutdoorMixNight.ActivateMix()
                    set OutdoorMix = OutdoorMixNight
DatalayerSystem / Datalayers Module verse-source
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]):