Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes

Hello! We are having strange bug in our project in Unity (2022.3.20f1) using Wwise 2023.1.4.
Because of maps in game are procedurally generated we are adding prefabs with Multi Position type ambient sources (Ocean and Lakes) through code.
But something went wrong, and every time with new map there's extra sounds are adding in the air, where it shouldn't be (due to top down view it is very noticeable). And this extra source plays both, Lake an Ocean in one place.
Profiler shows nothing weird. One thing I've noticed that attenuation window shows that this extra source is playing always second to last, or last spawned prefabs of Lake and Ocean , although this prefabs are still on their right places in game, when I check them in editor view.
In Wwise I've tried almost everything I could think about - changing to different attenuations, voice behaviours etc. - but with no results.
All prefab settings are checked - its static, multi position is on.
Here's also the parts of code responsible for creating and placing prefab in game.


public GameObject SpawnGO(string holderName, Vector3 position, GameObject goToSpawn, float rotation = 0, bool playAnimation = false, bool castShadows = true, string sendSoundEvent = null, GameObject soundEventGo = null)
    {
        GameObject go;
        go = Instantiate(goToSpawn, GetHolder(holderName));
        go.transform.localPosition = position;
        go.name = goToSpawn.name;            
        go.transform.rotation = Quaternion.Euler(0, rotation, 0);
        if (playAnimation)
            AnimationController.Play(go, WorldAnimationController.EType.Spawn, null, true, sendSoundEvent, soundEventGo);
        if (go.GetComponent<MeshRenderer>() != null)
            go.GetComponent<MeshRenderer>().shadowCastingMode = castShadows ? UnityEngine.Rendering.ShadowCastingMode.TwoSided : UnityEngine.Rendering.ShadowCastingMode.Off;
        else
        {
            var meshes = go.GetComponentsInChildren<MeshRenderer>();
            foreach (var mesh in meshes)
                mesh.shadowCastingMode = castShadows ? UnityEngine.Rendering.ShadowCastingMode.TwoSided : UnityEngine.Rendering.ShadowCastingMode.Off;
        }
        return go;
    }


public void SpawnAmbience()
    {
        List<Vector2Int> shoreTiles = new List<Vector2Int>();
        List<Vector2Int> lakeTiles = new List<Vector2Int>();

        for (int i = 0; i < playData.depthMap.GetLength(0); i++)
        {
            for (int j = 0; j < playData.depthMap.GetLength(1); j++)
            {
                if (playData.depthMap[i, j] == -InfoManager.Instance.oceanDepthForAmbience && playData.GetTile(i, j).terrainType == ETerrainType.Ocean)
                    shoreTiles.Add(new Vector2Int(i, j));
                else if (playData.depthMap[i, j] <= -InfoManager.Instance.minLakeDepthForAmbience && playData.GetTile(i, j).terrainType == ETerrainType.Lake)
                    lakeTiles.Add(new Vector2Int(i, j));
            }
        }
        shoreTiles = FindIntervalPoints(shoreTiles, InfoManager.Instance.oceanAmbienceInterval);
        lakeTiles = FindIntervalPoints(lakeTiles, InfoManager.Instance.lakeAmbienceInterval);
        foreach (var tile in shoreTiles)
            SpawnGO("Ambience", tile.ToWorldPositionXZ(new Vector2(0.5f, 0.5f), 5f), InfoManager.Instance.oceanAmbiencePrefab);
        foreach (var tile in lakeTiles)
            SpawnGO("Ambience", tile.ToWorldPositionXZ(new Vector2(0.5f, 0.5f), 5f), InfoManager.Instance.lakeAmbiencePrefab);

        List<Vector2Int> FindIntervalPoints(List<Vector2Int> allTiles, int distance)
        {
            List<Vector2Int> output = new List<Vector2Int>();
            if (allTiles.Count == 0)
                return output;
            int sqrDistance = (distance * distance);
            while (allTiles.Count > 0)
            {
                var addedTile = allTiles[0];
                output.Add(addedTile);
                allTiles.RemoveAll(x => (x - addedTile).sqrMagnitude <= sqrDistance);
                allTiles.Sort((x, y) => (x - addedTile).sqrMagnitude.CompareTo((y - addedTile).sqrMagnitude));
            }
            return output;
        }
    }


Please, help...)
Where the problem can be?  

in General Discussion by Serhii T. (100 points)

Please sign-in or register to answer this question.

...