Search Unity

[RELEASED] SECTR AUDIO: Immersive, Spatial Audio

Discussion in 'Assets and Asset Store' started by MakeCodeNow, Feb 21, 2014.

  1. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Ok. For a bird that actually moves and walks around the best solution is to script the audio logic, just like you script other parts of the bird's behavior. In a pinch, you can use silent wavs in the audio cue like you are doing now.
     
    felizimm likes this.
  2. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Hi, I'm enjoying using SECTR so far, really cool features and workflow, I have a couple of questions / issues.

    1. I noticed an issue when switching cameras for cut scenes etc, when I switch back from my cut scene camera location to my main FPS camera the directional audio seems to stay static at the location of the cut scene camera and no longer moves with me as I progress through the level. Is there something I am overlooking in a setting here?

    2. Whenever I have the Sectr Audio browser open there is now a noticeable pause, delay when exiting play mode in the editor, between 15 to 40 seconds in some cases, I run and exit playmode hundreds of times a day so it is really slowing me down and was not there before I installed sectr. Is there anything you know of I can do here to reduce that delay?

    3.I think I am just unsure how the music system works but I am using start music and then setting music triggers to swap to those tracks for battle scenes etc etc. I would like the music to return to the start music soundtrack after these events but can't find a way to do this unless I just play an audio cue. Am I using the start music feature incorrectly?.

    Thanks for any help:)
     
  3. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Glad you're enjoying SECTR! Answers below...

    1) I'm not sure what's going on here, but generally I recommend that people create a "microphone" game object that has the AudioListener and SECTR_AudioSystem components on it. Then just move that around the scene based on whatever the active camera is.

    2) Sadly this is a Unity thing where they create and destroy the window when you go into and out of play mode. You can set an Audio Root (right click menu in Audio Window) to make things a bit faster, but the fastest is to close the SECTR Audio Window when you are not using it.

    3) There really isn't much of a music system in SECTR (by design). Just a special slot that can play one cue at a time. You basically just need to call Start Music yourself whenever you want the music to change, even when it's just going back to the background.
     
    andreiagmu and hopeful like this.
  4. HeraticGalaxy

    HeraticGalaxy

    Joined:
    Aug 23, 2014
    Posts:
    31
    Hi, I am using he latest version of SECTR and having a small problem, not sure if I have missed something. I created a region source and assigned a cue to it and I can hear the sound ok however, I want to limit where the sound can be heard but I don't get the Min and Max circles on the object, they are just missing... have I missed something?
     
  5. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I just checked and the min and max circles do appear on RegionSource when it's selected. However, if your Cue is 2D or Infinite 3D they are auto-hidden.
     
    hopeful likes this.
  6. Radius

    Radius

    Joined:
    May 11, 2013
    Posts:
    51
    Hey, thank you for the answers so quickly!, excellent, that covers everything I was unsure about, much appreciated:)
     
  7. HeraticGalaxy

    HeraticGalaxy

    Joined:
    Aug 23, 2014
    Posts:
    31
    Perfect, thanks, I had my cue set to 2d :)
     
  8. salad__fingers

    salad__fingers

    Joined:
    Aug 11, 2012
    Posts:
    42
    I don't know if this is Unity or SECTR Audio, but I started a fresh project with SECTR Audio on U5.3 and I get about 70FPS in a demo scene and then tanks occasionally to about 13 fps. I wasn't having this issue before and there's no reason this should be happening on my machine.
    GTX 780
    FX-8350 OC @ 5.0ghz
    8gb RAM
     
  9. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hard to say what's going on there without more info. If you can post a screenshot of the profiler with one of those 13fps frames selected, that'll give me more info to go on.
     
  10. salad__fingers

    salad__fingers

    Joined:
    Aug 11, 2012
    Posts:
    42
    Here they are.


     
  11. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah, as you can see, all of the time is in Gfx.WaitForPresent(), which is waiting for a vsync to happen. There's no reason it should take 70ms, but that's a Unity rendering bug, nothing todo with SECTR AUDIO.
     
    hopeful likes this.
  12. salad__fingers

    salad__fingers

    Joined:
    Aug 11, 2012
    Posts:
    42
    This is really odd, I've never had this issue before.
    Do you know if there's a fix? I can't get anything to work to stop these constant spikes.
    Thank you
     
  13. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    There are a number of threads on the forums of users with similar issues. I suggest you check those out, and if that fails try to follow up with Unity directly.
     
  14. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    How to create an ocean of sounds I heard only on the beach?
     
  15. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    In SECTR audio, use a spline source with a looping waves sound.
     
  16. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hi I just came back to my project and I cant seem to hear any of my sectr stuff, just wondering what I should check to verify its all set up?
     
  17. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Check for errors in the console. And make sure that you can near regular, non-SECTR audio.
     
  18. Enki

    Enki

    Joined:
    Jun 2, 2013
    Posts:
    20
    Question of mainly a Unity problem...
    To work anywhere, I setup a local folder and added hard symbolic links for /Assets and /ProjectSettings pointing to a cloud drive. The Audio window now complains and won't show any cues. SECTR_Asset.cs ~220 calling AssetDatabase.FindAssets(). I printed out the path, and it's good, but it can't seem to handle the cloud drive. Any solution you may know of?
     
  19. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sadly, I don't know of any good solution. SECTR largely depends on Unity and it looks like their AssetDatabase.FindAssets() either doesn't support sym links or cloud drives or both.

    One workaround you can try is to go into SECTR_Asset.cs and find the GetAll<T> function. Just a few lines down is a big #if UNITY 4_ block. That code is the legacy path where I use C# to find your audio assets. It's much slower than using AssetDatabase.FindAssets but it might work with your sym links. You can turn that path on locally by adding your version to the list of legacy versions (eg add || UNITY_5_3 or whatever).
     
  20. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Been away, still no sound for me but I see many instances of this error:

    Cannot play sounds before SECTR_AudioSystem is initialized
     
  21. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    That's very likely the problem. You need to have an active audio system in your scene and if you are playing sounds they need to happen after the sound system is initialized (during OnEnable).
     
  22. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks I added an audio system, I only seem to hear one sound looping, my others dont seem to trigger, but no errors. Not sure how I broke it in the first place, any tips for what the most obvious answer might be ?
     
  23. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Very hard to say without more info. How are you playing the sounds? Are the 3D sounds close enough to be audible?
     
  24. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    46
    I actually just encountered what sounds like the same thing:

    The Audio Cue has 4 audio clips attached, local 3D, using Point Source. The cue is intended to loop, shuffling through the four sounds with a randomized range for delay.

    But, upon entering the point source playback area, it selects one sound at random (good), loops the same sound (not good), and with the same delay (not good).

    I'm going to dive deeper and see if I can find any other clues, but in the meantime, I've added sceenshots of the cue itself and the gameobject for the point source.
     

    Attached Files:

  25. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    46
    The plot thickens: I just went back to check another spot where I use a similar cue for a group of randomized one-offs, and it too is looping one clip with a static delay. This was definitely working before.

    I've also noticed some cues keep playing after I left play mode.

    Going to try on the device to see if it's also occurring in the build or if it is just happening in the editor.

    I'm still on 1.2.1a, I'm just too darn close to the milestone, and I've made a few mods here and there. If there's a specific bug fix in 1.2.1b I might try it out.

    EDIT:
    Hmmm... I'm starting to wonder if I've grossly mis-interpreted how to tackle this problem via the Point Source.

    Going to set these up with Environment Zones instead, as that seems to be working as expected.
     
    Last edited: May 2, 2016
  26. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I managed to fix mine, I just went through the quickstart guide again, turned a few on and off and messed around a bit and finally they worked again, wish I could be more exact :)
     
  27. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    So, what you are running into is actually working as intended, but I understand it's confusing.

    When you use Loop in the AudioCue, it picks an AudioClue and then sets the internal Unity/FMOD looping flag, which loops that clip forever. If you want to have a looping point source that randomly cycles through sounds on every loop, set the Loop flag on the point source, not on the AudioCue.

    Like I said, I understand that this is confusing, so maybe I will make the UI more clearly show the difference. Hmmm....
     
  28. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I dunno, but hooray!
     
  29. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yep sound makes all the difference! Actually unity had crashed and my project got messed up so lots broke, lost all my layers somehow etc. Anyway, awesome to have it back :)

    One question is there a way to have a sound fade out and in when it loops ? Pretty sure I ticked all the right things but it doesnt seem to happen
     
  30. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Glad things are basically working for you.

    There is no built in fade between loops logic, sorry.
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    OK cool its just hard to find perfect loops, would be a nice feature :)
     
  32. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah. You can actually make pretty good loops yourself if you know just a little bit of audio editing software. Basically put two copies of the sound one after another and setup a cross fade between the two. Then grab from the middle of the first clip to the middle of the second and export that as a wav file. In many cases, it makes for a very natural sounding, perfect loop.
     
  33. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    46
    Oooh, I didn't realize that setting loop at the Point Source would have a different behaviour - I thought it was an override for the cue. That might explain why I felt some cues were working before.

    That being said, I think it makes more sense for me to do these as environment zones. As a point source, it uses the min/max spatial properties of the cue, but I'm going to tweak those every time they're used. Much better than making a bunch of separate cues.
     
  34. marshmatter

    marshmatter

    Joined:
    Oct 2, 2013
    Posts:
    46
    p.s. awesome work on the whole SECTR series. I've been using Audio and Stream heavily, and it's so easy to get in and set up custom behaviours.
     
  35. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Awesome. Great to hear!
     
  36. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Hi there,

    I really love the entire SECTR series. I just lately moved from Master Audio over to SECTR Audio as I simply like the visual representation of the Buses/Cues a LOT better in SECTR Audio. Now I wanted to change the audio commands in my code (e.g. MasterAudio.PlayAndForget ..) and am stuck with simply not knowing how to do that in SECTR Audio. Like e.g. I want a sound to be played as long as I keep a button pressed ... didn't find any examples or documentation. Can you please point me to the right spot? :)

    Thanks a lot!

    [Edit:] I just now found an API documentation, but sorry it doesn't help me at all. Let's say I have a bus named "Master", another bus inside of that named "SFX" and inside of this one I have 3 cues named "A", "B" and "C". How would I programmatically play cue "A"? Something like SECTR_AudioSystem.Play("A") apparently doesn't work as it expects an AudioCue as parameter. But how do I get it from the list that I have set up in the SECTR Audio Window? I bet there's some kind of one-liner but I am too blind to see it ...
     
    Last edited: May 29, 2016
  37. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    The main idea to understand is that SECTR AUDIO isn't string based by referenced based, which allows for more efficient loading and unloading of audio data. That means you want to have a component with a public member of the SECTR_AudioCue. You assign this to a specific cue in the Editor, and then somewhere in your code you call SECTR_AudioSystem.Play() with that data. SECTR_PointSource is a good, simple example of how to do this.
     
  38. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Thanks for the quick answer! While I of course respect your design choices, this unfortunately makes it overly complicated for me compared to other solutions. I wanted an audio manager to exactly not have to do the public-var-editor-drag-and-drop stuff and have to go through all components when looking at changes but to be able to manage it centrally. Oh well, of course it's still a very nice product, just not for me (as I fire 100% of my sounds programatically).
     
  39. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sounds reasonable. If you really want to use a global string approach with SECTR, you can. You just need to create a global resource or component that includes a table that maps strings to audio cues. I don't provide that in SECTR because a lot of people would misunderstand how to use it correctly, but it's pretty easy to write if you want to.
     
  40. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Thanks again, I can try that, yes, it sounds doable for sure!
     
  41. mzsd

    mzsd

    Joined:
    Feb 17, 2015
    Posts:
    1
    I have a question about the connection of Sectr Audio with native Unity audio mixer introduced in version 5.
    Is it possible to use native Unity audio mixer for cues (i.e. audio source components) instead of Sectr Audio own mixing buses?
    I tried to find an answer in the manual but coulnd't.
     
  42. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR Audio has it's own mixing bus system and is not compatible with the Unity 5 mixing solution (although it does use Unity Audio Sources under the hood).
     
  43. wolfnet18

    wolfnet18

    Joined:
    Jul 31, 2014
    Posts:
    15
    Can anyone explain how the music system works. I am able to get the start music script to work normally when I start a scene but I want the music to change in certain areas, such as when you enter a bosses area, however when I use the music trigger script nothing seems to change.
     
  44. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    A music trigger is probably the best solution. If you aren't seeing any effect from the trigger, the layers probably aren't setup correctly between the trigger and the player's collider.

    You can also try using the playmaker integration, too, if you want things to be scripted but don't feel comfortable writing the C# code yourself.
     
  45. wolfnet18

    wolfnet18

    Joined:
    Jul 31, 2014
    Posts:
    15
    I'm familiar with plygame, not so much playmaker. I'm just curious how to set the triggers up because the docs said it's simple and fluid. I'm just not exactly sure how to call up the music player to swap over to the other player properly. I was in understanding that technically that zone is always playing the music so when you go in and out it fades back to the other area but not sure if that's a correct observation..
     
  46. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Unity has good docs for how to setup triggers and SECTR just leverages that standard setup.

    The music system in SECTR is very simple. There can be a music track and then you can change it or stop it. That's about it. There's nothing like what you describe where the system "remembers" the previous music and restores it when you exit the trigger (or in any other case). That kind of state based music is usually very application specific, so it's left to individual developers to implement that logic on top of SECTR.
     
  47. VirtualDawn

    VirtualDawn

    Joined:
    Sep 15, 2014
    Posts:
    31
    Hi! How can I make the impact sounds scale volume and pitch with the force of the impact? What about having maximum value for the impact so we could have two impact scripts that play different sounds depending on the force? Atm they play on top of each other, even if one is prioritised.

    Is it possible to somehow make dragging sounds, when objects collides with surface and moves on it continuously? Maybe you could add it as a new feature?

    What about if I'm holding an object and wave it back and forth and I want it to make sound then, in my hand in air, following the objects velocity for volume(basically fade in and out)? For example if I had a plastic bag or foil and waved that around.

    "SECTR VR sounds" "SECTR VR Interaction update"
    VR is gonna be big, so it could get you more sales. Of course you could do other VR optimizations also.

    Could you make more tutorial videos about SECTR customization? You could for example made that dragging feature and record the process and make it into SECTR custom script tutorial?
     
  48. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Good questions.

    For the impact sounds you could modify the script to simply scale the volume based on the force of the impact. How much to scale is likely to be game dependent.

    Dragging sounds are actually really tricky to do well and often involve a lot of games specific logic, so I don't plan to tackle it directly in SECTR, but all of the pieces are there. Same story with waving objects.

    I agree that VR will be big which is why SECTR audio should "just work" in and out of VR.
     
  49. VirtualDawn

    VirtualDawn

    Joined:
    Sep 15, 2014
    Posts:
    31
    Thanks for the info and SECTR audio does work really beautifully in VR.
    Here's our game's steam site:
    http://store.steampowered.com/app/513050/
     
  50. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Game looks super cool! Are you using SECTR in it? If so, which parts?