Custom Sounds Not Working

Discussion in 'Support!' started by tristan566, May 6, 2021.

  1. tristan566

    tristan566 New Member

    Messages:
    3
    Likes Received:
    1
    1. Summary and Description:
    There are some issues with custom sounds; a) custom sounds can be heard from any distance, at max volume, and even if obscured by a planet. b) custom sounds stutter or clip when camera movement is taking place.

    2. Code used (this is javascript, and based on mikeyh's custom sound mod): Example.png
    try
    {
    function audioSounds()
    {
    var files =
    [
    'EMG_weapon_fire.wav', 'EMG_weapon_hit.wav'
    ];
    //cues to be replaced, make sure files and this are 1:1
    var cuesToReplace = [
    '/SE/Weapons/veh/tank_light_fire', '/SE/Impacts/shell_tank'
    ];
    var fileLocation = '/pa/soundfx/'
    for(var fileIndex in files){

    api.audio.registerCueMod(cuesToReplace[fileIndex], fileLocation + files[fileIndex]);

    }

    }

    _.defer(audioSounds); // hack relies on synchronous code to defer register until after reset
    }
    catch (e)
    {
    console.error(e);
    }

    3. Steps to reproduce:
    Use code as above, but rename custom variables (i.e. EMG_weapon_fire.wav) to your choice, any custom sound will work. Then just proceed to a sandbox game and place and attack with the unit which uses said custom sounds (in this case any vehicle that uses the sound 'tank_light_fire', such as the Ant).

    4. Visual Proof (screenshots, videos, text):
    Copy link and paste
    https://streamable.com/931cgl
    Last edited: May 6, 2021

Share This Page