Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Official Audio system

Discussion in 'Open Projects' started by cirocontinisio, Oct 13, 2020.

  1. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    733
    Sorry to have missed this! I think the latest PR from island12 fixes this. Returning a handle was always the plan, I believe I left a comment in the code as a TODO some time ago.
     
  2. cfinger

    cfinger

    Joined:
    Feb 29, 2020
    Posts:
    2
    @cirocontinisio Forgive me if I missed this, but is there a way to play an Audio Cue that follows an object as it moves?

    I see how to raise an event that sets the position of the audio, but what about a moving object that is playing looping audio (for ex, a car).

    Edit: I created a new AudioManager on the moving object, with a new Sound Emitter Pool, and a new Event Channel. I'm using this channel for the sounds associated with the moving object, and the standard scene independent one for all other sounds. Seems to work for now :)
     
    Last edited: Feb 17, 2021
  3. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    733
    I'm not 100% sure we need it, since we don't have moving objects with looping sounds (for now). But I would like to add it.

    This is a bit of a hack :) The reason it works is that the AudioManager instantiates the pool of AudioSources under itself, so in this case they move the character, but... you should only have 1 AudioManager in the game, so it's hardly a good solution.

    We need to implement the feature. (the audio needs some love, tuning and testing, actually)
     
  4. cfinger

    cfinger

    Joined:
    Feb 29, 2020
    Posts:
    2
    That's what I figured. Although I wonder if it will become noticeable for sounds the character generates while moving, even for non-looping sounds. Either way, I'll watch for any updates on the audio !

    Most definitely a hack. And yes, it pools them as children of itself. I did think a bit about how to set the pool objects as children to other transforms but that seemed more hacky. Perhaps I'll have to forgo the scene independent AudioManager for now, and move it on scene transitions.

    Anyway, I'm hoping you do end up needing this feature in the future ;) PS- This project has been great to watch. Thank you.
     
    cirocontinisio likes this.
unityunity