{"action":"created","issue":{"url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/54","repository_url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk","labels_url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/54/comments","events_url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/54/events","html_url":"https://github.com/resonance-audio/resonance-audio-unity-sdk/issues/54","id":369481494,"node_id":"MDU6SXNzdWUzNjk0ODE0OTQ=","number":54,"title":"HMD's rotation is ignored, on a playing AudioSource, once another AudioSource stops playing","user":{"login":"masammut","id":5250276,"node_id":"MDQ6VXNlcjUyNTAyNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/5250276?v=4","gravatar_id":"","url":"https://api.github.com/users/masammut","html_url":"https://github.com/masammut","followers_url":"https://api.github.com/users/masammut/followers","following_url":"https://api.github.com/users/masammut/following{/other_user}","gists_url":"https://api.github.com/users/masammut/gists{/gist_id}","starred_url":"https://api.github.com/users/masammut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masammut/subscriptions","organizations_url":"https://api.github.com/users/masammut/orgs","repos_url":"https://api.github.com/users/masammut/repos","events_url":"https://api.github.com/users/masammut/events{/privacy}","received_events_url":"https://api.github.com/users/masammut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-12T09:55:31Z","updated_at":"2018-10-31T10:28:31Z","closed_at":null,"author_association":"NONE","body":"I'm not sure if this is a Unity, a Resonance Audio bug or if I'm doing something wrong, but on Unity >= 2018.2.2f1 the HMD's rotation (possibly position too, but untested) is ignored on a playing AudioSource, once another AudioSource stops playing (only tested with 2 AudioSources).  \r\n\r\n\r\nThis works fine in:\r\n- Unity 2017.3.1f1\r\n- Unity 2018.1.0f2\r\n\r\nSeems to be broken in:\r\n- Unity 2018.2.2f1 to 2018.3.0b5\r\n\r\n(Note: In this example I'm using SteamVR version 1.2.3 because version 2 has issue with 2018.3 at the moment, but I've managed to recreate the same issue using SteamVR 2.0.1 (see notes below))\r\n\r\nSteps to recreate:\r\n1. Start with a new project\r\n1. Assets / Import Package / Custom Package -> SteamVR.Plugin.unitypackage (from: https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/1.2.3)\r\n1. Assets / Import Package / Custom Package -> ResonanceAudioForUnity_1.2.1.unitypackage   (from: https://github.com/resonance-audio/resonance-audio-unity-sdk/releases)  \r\n1. If using >= Unity 2018.3 (beta at the moment) add OpenVR version 1.0.2 using Window / Package Manager\r\n1. In the Edit > Project Settings > Audio (or equivalent in Unity >= 2018.3)\r\n    1. Select Resonance Audio as the Spatializer Plugin \r\n    1. Select Resonance Audio as the Ambisonic Decoder Plugin.\r\n1. Create a new scene\r\n1. Disable Main Camera\r\n1. Add SteamVR \"[CameraRig]\" Prefab\r\n1. (Add a floor plane if you want)\r\n1. Create an empty GameObject at 0,0,0 and add the script attached below\r\n1. Attach a 5 second clip to both ClipLooped and ClipPlayedOnce (clips can be same or different, but make sure ClipPlayedOnce is around 5 seconds to have enough testing time)\r\n1. Save scene\r\n1. Press play\r\n1. While both clips are played (ie 1st iteration of the loop) rotate the HMD left / right and hear the audio panning depending on the HMD's rotation\r\n1. Then rotate the HMD so that the audio comes from the left ear and wait till ClipPlayedOnce finishes\r\n1. Rotate the HMD and observer that the audio from ClipLooped does not pan left / right anymore but remains at the same place it was when ClipPlayedOnce finished playing\r\n\r\nNotes:\r\n1. If \"audioSource2.Play();\" is commented out, then ClipLooped seems to come from the center and the HMD's rotation is ignored too.\r\n1. If the looping is inverted (ie \"audioSource1.loop = false;\", \"audioSource2.loop = true;\" and \"audioSource2.Play();\" uncommented) then it works fine (note: volume will be lower because of distance / occlusion)\r\n1. Also tested on Unity 2018.2.2f1 with SteamVR 2.0.1 (and the following change \"var ears = GameObject.Find(\"Camera\");\") and the same problem was observer\r\n\r\n```cs\r\nusing UnityEngine;\r\n\r\npublic class Sample : MonoBehaviour\r\n{\r\n\r\n    public AudioClip ClipLooped;\r\n    public AudioClip ClipPlayedOnce;\r\n\r\n    void Awake()\r\n    {\r\n        var ears = GameObject.Find(\"Camera (ears)\");\r\n        ears.AddComponent<ResonanceAudioListener>();\r\n\r\n        var cube1 = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n        cube1.transform.position = new Vector3(0f, 1.5f, 3f);\r\n\r\n        var cube2 = GameObject.CreatePrimitive(PrimitiveType.Cube);\r\n        cube2.transform.position = new Vector3(0f, 1.5f, 4f);\r\n\r\n        var audioSource1 = CreateAudioSources(cube1);\r\n        audioSource1.spatialBlend = 1f; // 1 -> full 3D.\r\n        audioSource1.spatialize = true;\r\n        audioSource1.spatializePostEffects = true;  \r\n        audioSource1.clip = ClipLooped;\r\n        audioSource1.loop = true;\r\n        audioSource1.Play();           \r\n        \r\n        var audioSource2 = CreateAudioSources(cube2);\r\n        audioSource2.spatialBlend = 1f; // 1 -> full 3D.\r\n        audioSource2.spatialize = true;\r\n        audioSource2.spatializePostEffects = true;  \r\n        audioSource2.clip = ClipPlayedOnce;\r\n        audioSource2.loop = false;\r\n        audioSource2.Play();\r\n    }\r\n\r\n    private AudioSource CreateAudioSources(GameObject go)\r\n\t{\r\n        var audioSource = go.AddComponent<AudioSource>();\r\n        audioSource.outputAudioMixerGroup = ResonanceAudio.MixerGroup;\r\n\r\n        var resonanceAudioSource = go.AddComponent<ResonanceAudioSource>();\r\n        resonanceAudioSource.occlusionEnabled = true;\r\n\r\n        return audioSource; \r\n    }\r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/comments/434636475","html_url":"https://github.com/resonance-audio/resonance-audio-unity-sdk/issues/54#issuecomment-434636475","issue_url":"https://api.github.com/repos/resonance-audio/resonance-audio-unity-sdk/issues/54","id":434636475,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDYzNjQ3NQ==","user":{"login":"andybak","id":60035,"node_id":"MDQ6VXNlcjYwMDM1","avatar_url":"https://avatars2.githubusercontent.com/u/60035?v=4","gravatar_id":"","url":"https://api.github.com/users/andybak","html_url":"https://github.com/andybak","followers_url":"https://api.github.com/users/andybak/followers","following_url":"https://api.github.com/users/andybak/following{/other_user}","gists_url":"https://api.github.com/users/andybak/gists{/gist_id}","starred_url":"https://api.github.com/users/andybak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andybak/subscriptions","organizations_url":"https://api.github.com/users/andybak/orgs","repos_url":"https://api.github.com/users/andybak/repos","events_url":"https://api.github.com/users/andybak/events{/privacy}","received_events_url":"https://api.github.com/users/andybak/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T10:28:31Z","updated_at":"2018-10-31T10:28:31Z","author_association":"NONE","body":"Could we get any acknowledgement about this issue from the devs? In general it's beginning to seem like this is an abandoned project - which is a shame."}}
{"actor":{"display_login":"andybak"}}