alessandrofama / wwise-godot-integration

Wwise Integration for the Godot Engine
Other
288 stars 14 forks source link

How to use Auxillary BUS - Using Convolution Plugin #32

Closed smksnutmeg closed 3 years ago

smksnutmeg commented 3 years ago

Hey! I understand how to update rtpc, but not sure how to use Aux busses? Is there anything on the Wwise object that allows me to tweak the values?

class BUSSES:
    const AMBIENCE = 85412153
    const AUX_AMBIENT = 1167680336
    const AUX_SCATTERS = 3457655549
    const MASTER_AUDIO_BUS = 3803692087
    const MOTION_FACTORY_BUS = 985987111
    const MUSIC = 3991942870
    const PM = 1635194320
    const SFX = 393239870
    const UI = 1551306167

    enum _enum {
        AMBIENCE = 85412153,
        AUX_AMBIENT = 1167680336,
        AUX_SCATTERS = 3457655549,
        MASTER_AUDIO_BUS = 3803692087,
        MOTION_FACTORY_BUS = 985987111,
        MUSIC = 3991942870,
        PM = 1635194320,
        SFX = 393239870,
        UI = 1551306167
    }

class AUX_BUSSES:
    const AUX_VERB = 1952219607

    enum _enum {
        AUX_VERB = 1952219607
    }
alessandrofama commented 3 years ago

If you want to send Sounds to an Aux bus with the API you need to activate the checkbox Use game-defined aux sends for your specific objects in the Actor-Mixer or Interactive Music Hierarchy in Wwise: image

Then you can call Wwise.set_game_obj_aux_send_values. This calls AK::SoundEngine::SetGameObjectAuxSendValues .

Example:

func _ready():
    var aux_send_values:Array
    var aux_send_value:Dictionary

    aux_send_value["aux_bus_id"] = AK.AUX_BUSSES.LARGEVERB
    aux_send_value["control_value"] = 12.0

    aux_send_values.append(aux_send_value)

    Wwise.set_game_obj_aux_send_values($"../AkEvent".get_instance_id(), aux_send_values, aux_send_values.size())

First argument ist the (Wwise) GameObject ID, you can get it by calling get_instance_id on the Godot Object you registered your Wwise GameObject with Wwise.register_game_obj, or in case you are using the AkEvent node, you can call it on the node itself as you can see in the example above. Second argument is an array containing dictionaries with info about your aux send. The aux_send_value dictionary needs two infos, one - the ID of the aux bus, two - a float value in the range [0.0f:16.0f] that represents the amplification factor applied to the sound going through the aux bus. Third argument is just the size of the array.

Does that answer your question?

smksnutmeg commented 3 years ago

Great I'll give it a go! Thanks

smks commented 3 years ago

I spoke to the music guys, they said they control the AUX sends, but not sure... does this mean I don't need to do anything code side if they do this already?

alessandrofama commented 3 years ago

If they already control them from Wwise you don't need to do anything code side.

alessandrofama commented 3 years ago

Closing as this seems to be solved.