Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Master Audio - AAA Sound Solution. #1 audio plugin on Asset Store!

Discussion in 'Assets and Asset Store' started by dark_tonic, Jan 28, 2013.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It should handle pretty much anything you want to do. We've had huge clients buy 500 licenses and request a lot of features in the past, so most things are already there.
     
  2. benoneal

    benoneal

    Joined:
    Apr 15, 2016
    Posts:
    31
    Hi. I'm making a game using the new ECS package, and everything I've read has said that it's impossible to do audio in pure ECS. I'd *really* like to have direct explicit control over what audio is played and every aspect of how it is played from my systems, and this would be very annoying/impossible with the standard AudioSource/AudioListener pattern.

    Does Master Audio expose a programmatic API that would give me complete control without requiring any Transform / GameObject / MonoBehaviours of any sort? ie: pure scripting control from ECS Systems?

    And if it does, could you give an example in pseudo-code of how I might wire this up and what methods to call?
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you could rephrase your question without mentioning ECS I may be able to answer it. I don't know anything about ECS so I can't answer on that front. We definitely don't have anything ECS specific in the product.

    The Master Audio API's is all static 1-liners so presumably you could call it from ECS code if that's mostly what you're using.
     
    Last edited: Aug 27, 2018
  4. androshchuk-vladyslav

    androshchuk-vladyslav

    Joined:
    Dec 13, 2015
    Posts:
    127
    @jerotas Hi. When I use system with UI, it sounds only in left chanel even if attached to caller. Thanks!
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Then my guess is that your audio listener is to the right. It is a 3D sound right? Special Blend rule is set to 3d? There is no pain control unless you're sound is not 3D
     
  6. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello I ant figure out how to tirn on ambient sound I did everything like in yout tuorial but ambient is not playing on scene start, I could invoke it in editor by click on play in sound group but without it it doeasnt work. Als o how I can manually change range of audio zone, cause it has only fixed numbers. I have river I want to make it be hear on whole of lenght, or for example strange shape forrest
     
    Last edited: Sep 11, 2018
  7. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ambient sounds will only play When the audio is within audible range. You should find when you get your audio listener close enough to the game object with the Ambient sound script it will start playing. When you get out of audible range it will stop playing. I'm pretty sure your audio listener is too far away based on the max distance of the audio source of the sound group you have chosen in ambient sounds. If it needs to be audible further away then you need to choose a different audio Source template and apply it to that sound group or to all sound groups, which is done on the master audio mixer.
     
  9. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Sorry I tested it ths way even on standalone scene as you advise me on e-mail. But it still emit no sounds, Even with 5000 max distance. I tested it 3 hours today I made everything like in tutorial and like in manual, but it emit no sound. Was system tested on 2018.2 Unity?
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes. Works for me.
     
  11. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    OK Thanks I sent you to e-mail my modified scene I hope you could help. Thanks for amazing support!
     
  12. EntertainmentForge

    EntertainmentForge

    Joined:
    Feb 20, 2014
    Posts:
    15
    Hello. I was wondering if SoundFinished even happens to fail sometimes?

    I am using it to play the next dialogue recording after the current one is finished. But once in a while, it seems to fail. I debugged this and found that SoundFinished event is added, but the function VoiceFinished(), that is supposed to be called, is not called when the sound finishes playing.

    This does not happen very often but it can happen.
    Unless I speed tests the game. Increasing the Time.timeScale to 15f, and audio pitch to x5 (like this: MasterAudio.ChangeBusPitch("Voices", 5f);) then it happens every time after a minute or two.

    Do you have any idea why this might be?

    Thanks!
     
  13. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hello Jerotas,

    I am using Master Audio in my project and I'm seeing myself a bit stuck right now as I'm creating a Cinematic sequence using Unity Timeline.

    My issue is that Master Audio is managing my musics. I'd like of course to have some specific musics in my cinematic and in Timeline I can only add regular audio clips which aren't impacted by master audio (so if a track is playing I would have two music playing)

    The best thing to me would be to be able to directly impact the Playlist controller from master audio from Timeline. I think it would require a Playable script.

    I'm not a coder and use Master Audio because of that, because it's really simple to handle without coding.

    I saw on the forum that it was in discussion: http://darktonic.freeforums.net/thread/681/timeline-unity-2017-1

    But the discussion stopped quite quickly

    Any chance you'd have a look on this topic anytime soon?

    thank you by advance
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry for not answering sooner, I didn't receive a notification of this change to my thread.
    I don't think it can fail to happen. However, if you are using Retrigger Limit to play sounds again before they end, then they didn't really end.

    If you want to send me an example Scene that makes it fail, then I will hopefully be able to fix it.
     
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I don't really know anything about the timeline or how to code for it. If you could point me to what I need to read, and let me know exactly what you need to do, I will move it up on the roadmap.
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    V 4.2.0 changelist, should be live in 10 minutes.
    • Fixed bug: music was ducking if SFX silent (muted, 0 volume etc).
    • Fixed bug: DGSC Sound Group with same name but different casing would cause error.
    • Fixed bug: Sometimes on Scene load, a persistent MA game object would log an error with Ambient Sounds script.
    • Fixed Inspector bug in Unity 2018.3.
    • Fixed bug: Ambient Sound - created scripts were not updating at Fixed Update when that was selected in Advanced Settings.
    • Breaking change: SongChanged event for PlaylistController now passes an additional parameter, which is the MusicSetting object. You will need to add it to your method signature if you are subscribing to that event. This new parameter lets you grab song metadata and other values from it.
    • Changed minimum Sound retrigger time interval to 0.05 seconds.
    • Added song metadata section for Playlists. Each Playlist can now have its own metadata properties you define. Each property has a name, data type, "is required", and "can have multiple per song" fields. Each song then lets you put values on each metadata property you use.
    • Added "specific variation" textbox to Ambient Sounds so you don't have to play a random one, although you still can.
    • Added mesh sphere gizmo for Ambient Sounds so you can see the audible distance of the Sound Group, and know how close you need to be in Scene view.
    • Added ability to configure Ambient Sound to fade the sound when it's out of range instead of stop abruptly. Useful for 2D sounds only really since you probably wouldn't hear it at the end of its max distance.
    • Added ability to adjust the Max Distance of the Ambient Sound script while seeing the sphere gizmo to represent its size.
    • Fixed bug in vp_Effect (UFPS integration package).
    • Bulk changes for Variations now work differently. No bunch of copy buttons. You just select the Variations you want, change a field and it affects all checked Variations the same.
    • Bulk changes for Songs in a single Playlist now added. You just select the Songs you want, change a field and it affects all checked Songs the same.
    • Removed "Show Variation Gizmos" in Advanced Options. No more 'M' Gizmos. Removed "Show Gizmo" in Event Sounds as well.
    • Added more Visual Settings options in Advanced Options. Show All Range Gizmos, Show Select Range Gizmos, and a color field for each. These control whether you see mesh sphere gizmos for Event Sounds and Ambient Sound showing the max distance of the selected audio.
    • Added "Show Range Gizmo" checkbox in Event Sounds for Play Sound action, and Max Distance slider.
     
  17. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Ok, I understand :)

    I'm not a coder (not good enough at least), but I tried to find the most specific guide about it and this one is pretty good:

    https://blogs.unity3d.com/2018/09/05/extending-timeline-a-practical-guide/

    Having MasterAudio timeline playables would allow to use MasterAudio engine for all the audio SFX and Playlists controls.

    At the moment Timeline allow us to insert audio tracks (their own playable item). But basically it ends up for me having Unity audio stuff and Master audio.

    I tuned everything in M.A to be like I want. So if I drag and drop a regular audio clip from my asset into Timeline, I'm not using M.A and that's not right to me, also because in M.A I might have setup some SFX with variation and specific volumes/pitch etc.

    Worse: Music control. If I want to have cutscene with music played, while Master Audio is playing its own playlist, that's an issue. At the moment I'm doing it the dirty way with some rough code to stop M.A Playlist and play the music from Unity which would be so much easier to manage from M.A directly.

    So my wish would be:

    -Able to add MasterAudio SFX tracks to start/stop/blend SFX from M.A groups (with the ID of the SFX group for example)
    -Able to control a MasterAudio Playlist from a track (Select the playlist and/or the clip to play)

    Those are all existing in your API, it's just creating those playable tracks with TimelineAPI that blocks me because I don't have the coding skills for it, but it doesn't look too complicated (I think!)

    If you need more ideas, or even a tester or else, I'm fully available. I'm right in the middle of it anyway
     
    nathanjams likes this.
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok thanks for hunting that down. I'll be taking a look soon.
     
    nathanjams and Necka_ like this.
  19. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    How can I smooth the sound from 0 to 1 with MasterAudio.PlaySound()?
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you want a "canned fade", you can set the Fade In time on the variation itself, and just play it.

    If you want a custom time fade, specify 0 volume with the PlaySound call and use the PlaySoundResult's ActingVariation property to do a FadeToVolume. There's a method.
     
  21. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    How to play sound without Transform? I want to play the sound in the background, not the background music, just the sound effect.
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    If you don't want to use a transform then use one of the methods that doesn't have the word transform in the title such as PlaySound3DAndForget.

    Make sure you set the Special Blend rule for that sound effect to 2d so that it doesn't matter where it's playing from.
     
  23. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I get it,thanks for reply.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Anytime.
     
  25. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    1.I set Fade In time(sec) and Fade Out time(sec),and used PlaySound() and StopAllOfSound() for sound effects.Fade In works very well, Fade Out doesn't work, the sound still stops suddenly.

    2.How can I disable the normal Debug.Log()? It always reminds me "MasterAudio All children of were busy".
     
    Last edited: Oct 12, 2018
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    #1, StopAllOfSound does what it says - stop. It will ignore the fade and just stop it. There are FadeSoundGroupToVolume commands that do a fade, but both ignore the Fade Out time. Fade Out time is just used for a normal non-looping sfx and you just need to play it, it will do the fades.

    #2, Turn off "Log All Sounds" in Advanced settings. It's off by default but you may have turned it on.

    Let me know if that works.
     
  27. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I get it,thanks.:)
     
    jerotas likes this.
  28. diane1804

    diane1804

    Joined:
    May 11, 2016
    Posts:
    3
    Hi !

    I'm trying to play a sound at a specific time :

    playSoundResult = MasterAudio.PlaySound(sound);
    playSoundResult.ActingVariation.JumpToTime(startTime);

    But playSoundResult.ActingVariation.VarAudio.time is always 0, regardless of startTime value (the time in seconds, a float).
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The only reason I can think of that this would happen is if you're using a Resource file, because it has latency to start and it would basically set it back to 0 or whatever custom start time you've set (if any).

    Can you show me a screen shot of your Variation's settings in the Inspector? And the Audio Clip's import settings too...
     
  30. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
    Just to let you know. I'm trying out Unity 2018.3.0b6 and can't create new sounds by dragging them into the group creation area.

    https://i.imgur.com/CtEsn6l.png

    ArgumentException: The Object you want to instantiate is null.
    UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:383)
    UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:206)
    UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:285)
    MasterAudioInspector.CreateSoundGroupFromTemplate (UnityEngine.AudioClip aClip, System.Int32 groupTemplateIndex) (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:5044)
    MasterAudioInspector.OnInspectorGUI () (at Assets/Plugins/Editor/DarkTonic/MasterAudio/MasterAudioInspector.cs:1644)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1598)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That's a beta right? Where do I download it from?
     
  32. summerian

    summerian

    Joined:
    Jul 6, 2014
    Posts:
    140
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Basically the new prefab system has jacked all the lists of prefabs in the Master Audio game object. You could fix it by going to debug mode for the prefab and deleting all the Audio Source Templates and Group Templates, then dragging those into the Inspector when back in normal mode. It will only let you do this when the lists have zero items because it realizes there's a problem. Use the "lock" button to lock Master Audio Inspector so you can drag all of each type in without losing the Inspector.

    I'll have to make a button in the Inspector to do this for the next version.
     
    summerian likes this.
  34. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I have two scenes, one scene is added to another (additive mode), Master Audio does not work in the additional scene (no sound), what should I do?
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I would guess you're using a persistent Master out of you game object? What problem are you specifically having? Dynamic Sound group Creator will not work in a additive seen with a persisting master audio game object because code cannot access anything in an inactive scene. So it doesn't even know it's there. This is how Unity works. If your master audio game object is persistent then you will need to add code to move the game object to the active scene after you load it and before you make the other scene inactive.
     
  36. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    My main scene has MasterAudioManager, the additional scene is responsible for the backpack UI, I want to play the sound when I open the backpack.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That doesn't really help me troubleshoot at all.

    How are you trying to play the sound for the backpack? What does and does not happen? What does the Console say if it fails? Did you turn on "Log Sounds" in Advanced Settings?
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I have fixed this for the next release. You can email me for the Inspector code, which is all that has changed. support@darktonic.com
     
    summerian likes this.
  39. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I get it now. As you said , it need to add code to move the game object to the active scene.
    Thanks for reply.
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Most likely that will fix it. Let me know if it works for you. I don't do any multi-scene stuff, but from what I've read it's likely what's going on.

    It would be nice if I could make it automatically do that...show me the code you end up writing too.
     
  41. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I just transferred my backpack object from the additional scene to the main scene, nothing special.

    I think the problem is mainly that the additional scene has its own AudioListner, which cannot use the AudioListner of the main scene.
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, I mean if you end up writing code to move Master Audio game object into a different Scene, and that fixes it. What does that code look like?

    Correct that only one Audio Listener can be used.
     
  43. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    My additional scene doesn't have a Master Audio game object, so I didn't move it.
     
  44. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You might need to if it's in an inactive Scene. Code won't be able to access it to play sounds if the Scene it's in is inactive.

    And/or you could try destroying / disabling the other Audio Listener.
     
  45. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    It makes sense. I will do more testing, Thanks.;)
     
    jerotas likes this.
  46. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    I found no sound because I used the "3D" sound effect. When I changed it to "2D", everything was fine.
     
  47. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    What's the compatibility situation visavi MasterAudio and the new prefabs? I'm returning to MasterAudio after some time, and running 2018.3.0b7 I find that MasterAudio seems confused about whether prefabs reside in the Project or the Hierarchy. Also, there are no playback buttons in created sound groups, even though the width has been set to wide.
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm not going to be able to help you any further until you send me an example project, then I'll find the solution for you.
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, Unity screwed up the prefabs in 2018.3. The main thing is that only 1 of the Audio Source & Group Templates gets brought over, which creates errors when trying to create Sound Groups.

    I've already fixed it for the next version. You can either email me with your Asset Store invoice PDF (not just the number) for the beta, or go into debug mode for the prefab and delete all entries in the lists for each template. Then when returning to prefab mode you will be able to bulk drag all the templates into a drag area if you lock the Inspector. Then it should work properly again.
     
  50. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    239
    No, you misunderstood me. My English is not very good, so I didn't make it clear. I mean I have solved this problem, I am telling you how to solve it.

    My problem: There is no sound in the additional scene.

    My solution: Change the sound effect to be played from 3D to 2D, then the additional scene will have sound.

    Don't have to move anything from the additional scene.
     
    Last edited: Oct 29, 2018