Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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. shaunevans

    shaunevans

    Joined:
    Feb 5, 2014
    Posts:
    1
    Quick question: is there a way to stop all audio from MasterAudio? (In code) I know there is a stopAllOfSound and stop all of channel, but I need to stop everything, preferably with one command. Let me know if this is possible!
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    There is not. You can mute everything (playlist and mixer are separate commands) but not stop everything. I think it's good to add a few methods and Playmaker actions for this. I'll do so in the next version or 2. Thank you.
     
  3. CarlY

    CarlY

    Joined:
    Nov 5, 2013
    Posts:
    29
    Hello,

    First of all great plugin :)

    I've a function like the following that I use to adjust the music

    Code (csharp):
    1.  
    2. public void AdjustMusic()
    3.     {
    4.         MasterAudio.SetGroupVolume("Track01",MusicLevel);
    5.         MasterAudio.SetGroupVolume("Track02", MusicLevel);
    6.         MasterAudio.SetGroupVolume("Track03", MusicLevel);
    7.     }
    8.  
    These tracks are in a dynamic group, that persists between the scenes. When I go to next scene and turn back, I get the following error when I use the AdjustMusic() function.

    Could not grab Sound Group 'Track01' because it does not exist in this scene.
    Could not grab Sound Group 'Track02' because it does not exist in this scene.
    Could not grab Sound Group 'Track03' because it does not exist in this scene.

    Now, I can see that dynamic group is still in the scene, and Track01 is playing during this time. I don't believe this happened before the latest update but I'm not so sure. This is tested in a windows 7 machine and in editor.

    Any suggestions?
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Describe why you're using a dynamic group and need it to persist between scenes (these are meant for per-Scene sounds usually). It sounds like you may have more than one of the Dynamic Group when you hit the same Scene for the 2nd time. Which makes sense (the persisted one + the one that gets created when you load the Scene again). More than one of the same named item will not work...
     
    Last edited: Apr 3, 2014
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Master Audio V 3.4.7 will be live in 20 minutes. Changelog:

    • Removed the 2 methods in MasterAudio.cs that have been deprecated for a few months now.
    • Added a new Master Audio Clip Manager tool under the Window menu. This lets you see all your project's Audio Clips, and do bulk operations on them like change sample rate, load type, etc.
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I just found out the Clip Manager window we just added isn't usable with more than 80 or so clips. It hangs. I'll be aiming to fix that soon.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Never mind, I found the problem. Resubmitting now, will be live in 10 minutes! I ran it with over 200 clips and it's quite snappy and responsive now.

    Here's a picture of the Clip Manager. I'm sure we'll end up adding more things to it over time. Let me know what else you need in there after you use it!
    $clipManager.PNG
     
    Last edited: Apr 4, 2014
  8. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello jerotas,

    Thank you for this great asset!

    Is there a possibility to configure frame-independent playback using the Master Audio?

    What I want to do is to create a sequence of sounds that should be played with a constant delay. Let's say I want to create a drum machine. I am calling Play() functions in Update(), but it is all fine only if the framerate is high and constant.

    I could put it in the FixedUpdate(), but if I want to make the playback faster (so the pause times between each sound will be lower) then the result will be distorted.

    I've found out Unity function AudioSource.PlayScheduled() which theoritically solves that issue, but I cannot find it anywhere in MasterAudio source code.

    Cheers!
    Piotr
     
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    We have the delay parameter in PlaySound methods which is basically the same as PlayScheduled except that it also works for our customers that are on Unity 3.5.7. Does that not work in some scenario? I use it quite often myself and haven't seen any problems. Although if you're at a very laggy frame rate a lot of things don't work well. Not sure if this one does.
     
  10. cloudcamaleoniv

    cloudcamaleoniv

    Joined:
    May 17, 2013
    Posts:
    57
    Hello, can I make a playlist music loop from an offset time?

    To be more clear, I have a 50 second song, but the first 5 seconds is part of the intro. After the 50 seconds passes, I want to loop back to the 5 second mark instead of the 0 second mark.

    Can I easily do this? Thanks.
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    No. We don't support custom loop times currently. It is already on my to do list, but it's getting rather long at this point (~15 items). You can of course split the first 5 seconds into a different clip and handle it that way.
     
  12. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    137
    In anticipation of our 24-hour $11 Master Audio sale tomorrow (85% off), Core GameKit is now on sale for $5! Insanity sale for a limited time!
     
  13. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Thank you for the reply!
    I am still in process of implementing it. I will let you know about the results ;-)

    Cheers!
    Piotr
     
  14. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    this was a pretty killer deal... had to pick them both up.

    I hope their is an upgrade path for Unity 5 when its' released!
     
    Last edited: Apr 9, 2014
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Sounds good, let us know if you run into any problems!
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Master Audio does not automatically resample anything. I read that when you export to certain platforms (mobile particularly), Unity automatically resamples to a certain bitrate. I'm not sure if that's true or not, but definitely Master Audio does not do anything like that. And yes, you can resample and change other audio clip properties in bulk with our new Clip Manager window (or another application).
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Thank you tswalk! When Unity 5 comes out (we're on the beta tester group), we will be making a new version that probably removes ducking and buses since those will be available natively at that point. Whatever's missing from Unity buses we will add on top if possible (voice limit etc). Definitely we will be the first audio plugin on the store to have Unity 5 compatibility. At that point there will likely be 2 versions of MA (one for Unity 5 folks and one for those folks not upgrading right away), but you will not need to pay for an upgrade.
     
    Last edited: Apr 9, 2014
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    Thanks for the insane offer, bought both assets :)
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Thank you for the support! By the way, due to the recent popularity of DF-GUI, we will be adding DFGUI support very soon.
     
  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    Just bought that too a few days back :), good to know
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    You're welcome. We're always here to support you guys!
     
  22. palaxe

    palaxe

    Joined:
    Dec 31, 2013
    Posts:
    22
    Yes Thanks for the great sales price.
    I look forward to using it.
     
    Last edited: Apr 10, 2014
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    palaxe, you seem to have edited your comment. Are you having a problem with a class name conflict with another package? My email said something to that effect.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    The 24-hour sale was our best ever! Welcome to the 784 new users of Master Audio! We have many new updates on the way.

    As a thank you, we are having a follow-up sale, starting now, for 67% off, which is $25. Still a screaming deal by any count. The Core GameKit $5 sale we have extended one more day, so you can still pick that up for another 24 hours as well. It's normally $45.
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Master Audio V3.4.8 will be live in 20 minutes. Changelog:

    • Greatly improved all other Inspectors performance (unnecessary "repaint" was there).
    • Fixed the performance hiccup on streaming songs when changing songs on PlaylistController (CoRoutine now used).
    • Improved performance hiccup on Resource loading.
    • Added "Fire Custom Event" Playmaker Custom Action (the EventSounds no code action already existed but not Playmaker).
    • Fixed bug where pausing a SFX would not let it resume when unpausing the Sound Group.
    • Added PauseMixer, UnpauseMixer, StopMixer, StopEverything, PauseEverything, UnpauseEverything, MuteEverything, UnmuteEverything methods. The "Everything" methods affect all Sound Groups and Playlists as well.
    • Added Playmaker Custom Actions: MasterAudioMixerPause, MasterAudioMixerStop, MasterAudioMixerUnpause, MasterAudioEverythingMute, MasterAudioEverythingPause, MasterAudioEverythingStop, MasterAudioEverythingUnmute, MasterAudioEverythingUnpause
    • Added Global Command action type to EventSounds. Global Command types are: PauseMixer, UnpauseMixer, StopMixer, StopEverything, PauseEverything, UnpauseEverything, MuteEverything, UnmuteEverything
    • Now showing the full path and file extension for all clips in the Clip Manager window when you hover over the Clip Name column.
    • Now in the Clip Manager window, auto-selecting the audio clip when you modify any field, and showing the clip properties in the Inspector.
    • Deleted upgrade wizard and deprecated classes in Dynamic Sound Group Creator.
    • Upgrade note: Please check your settings for random pitch in all Variations and take note of what they are before upgrading - they will be lost. Now there are 4 settings: Use random pitch, random pitch min, random pitch max, and Pitch compute mode: choices are Add to clip pitch (default) and Ignore clip pitch.
    • Upgrade note: Please check your settings for random volume in all Variations and take note of what they are before upgrading - they will be lost. Now there are 4 settings: Use random volume, random volume min, random volume max, and Pitch compute mode: choices are Add to clip volume (default) and Ignore clip volume.
     
  26. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    Hi. New customer here, looking to adapt existing code to use Master Audio.

    With regards to the PlaySound method in the API description, it says "This method allows you to play a sound in a Sound Group in the location of the Master Audio prefab." Does this mean that it is playing it in 3D, using the location of the Master Audio prefab for its positioning reference?

    That seemed a bit odd to me, and would mean that to play a sound in 2D I would have to use one of the PlaySound3D methods instead (passing a null transform). Or is the Master Audio prefab kept at the position of the listener so it always sounds 2D?

    Sorry if these are obvious questions, I did a quick search of this (long) thread but found no explanation.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Correct about your first paragraph. 2nd paragraph is incorrect. If you want to play a 2d sound, you have to make it 2d first. Here's how: click on the Audio Clip in your Project view, and turn off the "3d sound" checkbox in the Inspector and hit Apply. Or use the Master Audio Clip Manager to do this in bulk.

    No matter the location / position of a 2d sound playing, it will sound the same (because no doppler settings and things like that). Generally I use PlaySound for 2d sounds, so I don't care what the position is. I'm just mentioning the position in case it matters to someone.

    The Master Audio prefab does not move ever. Does that answer your questions?
     
    Last edited: Apr 11, 2014
  28. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi jerotas, thanks for the update.
    I updated my project because I was having a problem with one of my Sound Groups cutting out for no reason (without any muting, pausing, or stopping sound actions), usually happening around when my PlaylistController would change songs. I thought the first few fixes in the quote above would hopefully fix it. After upgrading, I found that all my selected sound groups on ALL my EventSounds scripts are empty, and I have to go through 8 scenes now reselecting them (and there are a lot!) :(

    I was a little bummed as the EventSounds script wasn't mentioned in the Upgrade notes above, but what must be done must be done if there is a chance of having the soundgroup cutting out fixed. Have you heard of this particular problem of a soundgroup just not triggering anymore?
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I think you missed at least a couple versions. You didn't read the release notes for all of them unfortunately, which is always the 2nd post in this thread on page 1. V3.4.6 has this:

    Breaking change: Added the ability to specify multiple actions to trigger in Event Sounds script for each event, which get executed in order when the event occurs. By "breaking change" I mean that any EventSounds settings you had set up before will be lost after upgrading. You'll need to set them up again. This was unavoidable. So take note of what you have before upgrading.


    Sorry that you have to redo your settings, it was unavoidable. At least EventSounds is far more flexible and powerful now.

    I have not heard of a Sound Group not working after awhile. Does it use resource files or normal audio clips? Are you using the "auto prioritize" feature? That could do it based on distance. Our new game has about 80 Sound Groups and we have no problems regardless of what the Playlists are doing.
     
    Last edited: Apr 11, 2014
  30. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Yeah I see it now on the second post, and I did indeed miss a few versions. No problem, redoing them is not so bad if it means extra functionality.

    The Sound Group which stops working is not using resource files. I am using the autoprioritize feature, but there are no other sounds which are being triggered at the time it just stops working, and sometimes nothing is happening at all when it stops. Also it is the closest 3d sound. I'll see if I can narrow it down further other than happening when the playlistcontroller advances to the next song.
     
  31. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    Yes, perfectly clear, thanks a lot. Another question now: the code I'm adapting is modifying the rolloffMode of an AudioSource before playing a sound on it. I dont see an equivalent for doing this with Master Audio yet. Did I miss something?
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    You can look at the priority of the Variations in the Sound Group when it stops working. However, yes all Audio Sources should be heard unless you have more than 32 Audio Sources playing at the same time. Master Audio does not manually mute them in this priority code. It only sets the priority and lets Unity handle the rest.
     
  33. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    You could modify the rolloffMode or any other audioSource properties immediately after the sound starts playing (should run same frame). You would access it like this:

    Code (csharp):
    1. var result = PlaySound3d(yourParams here);
    2. if (result.SoundPlayed) {
    3.    result.ActingVariation.audio.rolloffMode = whatever.
    4. }
    5.  
    That should do what you want.
     
  34. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    perfect, thanks
     
  35. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    if I call PlaySound3DFollowTransformAndForget or PlaySound3DAndForget with parameter attachToSource=true (not sure if these do the same thing), what happens when the gameObject owning the transform is destroyed? I mean will the sound stop as well? Thanks.
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    No, the sound will not stop automatically. It will just stop following since there's no Transform anymore, and will remain at the last known location until the sound is finished playing (if it's looping, it will never "finish). If you want that variation to stop playing you can use the ActingVariation object to stop it.
     
  37. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Just an update that it was due to me forgetting to re-enable the EventSounds script on an object being used in a pool. That object got reused around the time the Playlist controller was moving to the next song, hence my confusion. Sorry for the trouble.

    Also, did you find out if it is feasible to have an option to implement the fades while timescale=0 (from a suggestion a page or two back)? Thanks.
     
  38. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Ok, good to hear that you figured it out.

    The fades problem is still on my list. That and adding DF-GUI should be in the next version unless I run into some weird Unity limitation that we can't work around.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I worked on DF-GUI tonight and got it all squared away. Here's the package for those who don't want to wait for the next version.

    View attachment $MA_DFGUI.unitypackage

    And this is what it adds:

    • Added optional package MA_DFGUI for Daikon Forge GUI integration. Created DF_ButtonClicker script. It works exactly the same as the included ButtonClicker, but is for DF-GUI instead of NGUI.
    • Made a new version of EventSounds for DFGUI users. It's in the MA_DFGUI package. It adds the following events: DFGUI Click, DFGUI Double Click, DFGUI Mouse Down, DFGUI Mouse Up, DFGUI Mouse Enter, DFGUI Mouse Leave, DFGUI Drag Start, DFGUI Drag End.
     
  40. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Uhm, in the scene view, how do I deactivate Master Audio's icon? Why did you include such a big icon to represent the Master Audio prefab anyway ... Makes it impossible to setup stuff. Or am I missing something?
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I'm not at my computer right now, but I believe you can toggle that icon with the Gizmo menu on the prefab (top-left in the Inspector). Just pick "none". The size of the icon has much to do with how big the objects in your scene are. In our projects, the icon is not huge in the scene.
     
  42. Resistance21

    Resistance21

    Joined:
    Mar 14, 2013
    Posts:
    3
    Hi,
    I'm working on a project where the user can select their own music on their PC.
    I have a working file browser which I am using to get the sting for the location of the file, I am storing that string in Play Maker.
    What I want to know is can I take that sting from play maker and have Master Audio load the song into a audio source?

    Thanks.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    As far as dynamic loading of music, only Resource folders are supported currently, not folders on a user's device. What you want to do is load a "file:\\" path. We could theoretically make that a new option using the WWW object to load it as a file, however I don't believe there's a way to release that audio memory when you're done playing the song.

    To me, that would make this option unusable. Would you still want it?
     
    Last edited: Apr 14, 2014
  44. Resistance21

    Resistance21

    Joined:
    Mar 14, 2013
    Posts:
    3
    To be honest I'm not sure.

    What would you say that best way to go about doing what I'm trying to do is? (I'm still very new to unity)

    The project wants to have it so that the players can select their own music to be used when they are playing instead of giving them a set amount of songs to pick from.

    I guess best example would be like with "Audio Surf" with how you choose the song you want to use.

    Thanks for any help.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I'm not sure either. Last week I tried using the WWW object as an option to not block the main thread when loading resources. Works fine in that respect, but I could not find any way to release the audio memory, so I didn't roll that in to the product. And that is the only way I know (WWW object) to load a local file into an Audio Source. But if the user loaded 5 songs in a row with your method, it might crash their device from lack of memory. And there's apparently nothing I could do to prevent that.

    So I'm very reluctant to add this feature. I posted in a thread in the Scripting forum last week here to see if anyone knew a way to release the memory, but no one responded.
     
  46. Resistance21

    Resistance21

    Joined:
    Mar 14, 2013
    Posts:
    3
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Yeah, looks exactly like the code I tried last week. It does play the audio file, but as I said, I couldn't find a way to release the audio memory afterward. And we won't add in code knowingly that creates a memory leak, which technically is what it would be.
     
    Last edited: Apr 15, 2014
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Master Audio V 3.4.9 will be live in 20 minutes. Changelog:

    • Added optional package MA_DFGUI for Daikon Forge GUI integration. Created DF_ButtonClicker script. It works exactly the same as the included ButtonClicker, but is for DF-GUI instead of NGUI.
    • Made a new version of EventSounds for DFGUI users. It's in the MA_DFGUI package. It adds the following events: DFGUI Click, DFGUI Double Click, DFGUI Mouse Down, DFGUI Mouse Up, DFGUI Mouse Enter, DFGUI Mouse Leave, DFGUI Drag Start, DFGUI Drag End.
    • Turned off "log everything" and Fast GUI Refresh in Master Audio for default settings.
    • Renamed "Mouse Click" event in EventSounds to "NGUI Mouse Click".
    • Fade Group To Volume now works with zero time scale.
    • Fade Bus To Volume now works with zero time scale.
    • Fade Playlist To Volume now works with zero time scale.
    • PlaySound commands now work with all options at zero time scale.
    • LED's on mixer now work with zero time scale.
    • Made Master Mixer Volume, Master Playlist Volume and Master Crossfade Time controls in Master Audio Inspector able to accept typing in the value.
    • Fixed bug: Fading a playlist with less then full Master Playlist Volume doesn't hit the right target volume on the individual playlist.
     
  49. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Awesome, thanks!
     
  50. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    True, the Master Audio icon being so obnoxious for me has to do with my specific setup. Changing the icon to "None" does nothing, however :(