Simple-Unity-Audio-Manager

A decentralized audio playing system for Unity, designed for simplicity and built to scale!

MIT License

Stars
541
Committers
4

Bot releases are hidden (Show)

Simple-Unity-Audio-Manager - 3.0.2 Hotfix

Published by jackyyang09 3 months ago

Some early work on Unity Timeline integration ended up seeping into the Release build, causing syntax errors for users who don't have the Timeline package installed

Fixes

  • Early Timeline code is now hidden by a preprocessor definition. (#38)
    • A way to import "addons" for Unity Timeline and other features will be added in future versions of JSAM
Simple-Unity-Audio-Manager - 3.0.1 Release

Published by jackyyang09 3 months ago

Sorry for the delay, things have been hectic for me.
There have been so many fixes since the first preview release of Version 3 that we may as well skip 3.0 proper.

Changes

  • You can now preview multiple Audio File Objects at the same time. Previously using the floating "Properties" window or opening two Inspector Windows to preview different Audio File Objects would not let you preview the sounds independently. But now you can!
    • This allows you to use the JSAM Playback Tool as an in-Unity jukebox, for when you really like your game's soundtrack 🎶
  • The Loop Point Tools foldout in Audio File Object inspectors can now be open/closed regardless of the Loop Mode

Fixes

  • Fixed an issue with the "Play Random" button in the SoundFileObject Inspector's Playback Preview that caused every AudioClip except the first clip in the Files list to be demoed
  • Fixed an unnecessary GC call in PlaySound (#35)
  • Audio File Wizard now checks if a valid output folder is provided, disabling the "Generate" button otherwise (#28)
  • Fixed the SoundFileObject and MusicFileObject inspector windows breaking if an AudioClip they rely on is deleted (#36)
  • Fixed regression in BaseAudioChannelHelper that throws an error when fading in a sound
  • Fixed StartingPitch property not being used where it should have been
    • Adjusted the tooltip for this field, removing mentions of "negative pitches"
Simple-Unity-Audio-Manager - 3.0 Alpha Preview 7 Latest Release

Published by jackyyang09 12 months ago

Even more fixes!
Some of these were a long time coming.

Changes

  • The default Audio File Preset path is now set to Assets/JSAMPresets
    • You can change the path in Project Settings/Audio - JSAM/Editor/Presets Path
    • The default presets can still be found within the JSAM package folder. The default presets will always be loaded
  • The Stop Sounds on Scene Load setting has been renamed to Stop All Sounds on Scene Changed. The behavior associated with this setting has been adjusted accordingly.
  • Added Stop All Music on Scene Changed setting
  • Added a check during Audio File preset creation that ensures the Preset path defined in the Project Settings exists.

Fixes

  • Fixed a warning that appears when JSAM is imported for the first time
  • Fixed AudioManager trying to do things while you're in prefab mode
  • Fixed AudioManager trying to look for an AudioListener in OnValidate, this should cause less log messages to appear in console when loading scenes
  • Fixed some inspector-specific behavior with Sound/Music Player components
    • Fixed Advanced Mode not being toggleable if there was no Library set in the AudioManager and the component was missing an Audio File reference
    • The "use advanced mode" warning now goes away when Advanced Mode is enabled
Simple-Unity-Audio-Manager - 3.0 Alpha Preview 6

Published by jackyyang09 about 1 year ago

More fixes!
Some more fixed than others.

Fixes

  • Fixed AudioSource spatialization only happening after the sound is played
  • Suppressed an error being thrown when trying to preview a Sound/Music File Object whose missing their AudioClip references
    • Of course, you still should not try to use an Audio File Object that has no AudioClips
  • Made playback preview time label mono-spaced so it's nicer to look at during playback
  • Fixed "Select an Audio File to preview it here" label in the JSAM Playback Tool becoming black when the cursor is not hovering over it
  • Fixed JSAM throwing an error when you reload the current scene and then try to change the volume
  • Removed deprecated volume-related event references from Sound/Music Channel Helpers
  • Made the height of the lock button the same as other buttons in the JSAM Playback Tool
  • Fixed JSAMPaths having a syntax error specifically in Unity versions before 2021.3
Simple-Unity-Audio-Manager - 3.0 Alpha Preview 5

Published by jackyyang09 about 1 year ago

A small release to compile some recent fixes to some annoying issues.

Fixes

  • Fixed errors being thrown when trying to build
  • Fixed null references thrown when changing volume with Unity's enter play mode option enabled
  • Fixed JSAMStartupWindow not actually saving the fixed package path if it detects an invalid path
  • Fixed Samples~.meta warning appearing when importing JSAM as a git URL
Simple-Unity-Audio-Manager - 3.0 Alpha Preview 3

Published by jackyyang09 about 1 year ago

Still not very sure when to drop the alpha/preview tag from the version 3 release.

For those curious why 2 was skipped, it's because I pushed Preview 2 stealthily via editing the package manifest in the git repo without making a new Unity package.

If you're using Unity 2020 and later, try installing the package through the Package Manager to get access to updates like Preview 2 and 3 more easily

Major Changes

  • Added a ChannelOverride property to Audio File Objects, so your SoundFileObjects can have their volume controlled by the Music slider and your MusicFileObjects can have their volume controlled by the Sound slider instead
  • Added a "Voice" volume channel to the AudioManager component
    • To use the new Voice volume channel, use the ChannelOverride parameter
    • Removed the volume mixer group parameters since they conflicted with the current Volume paradigm
  • Improved AudioPlaybackTool
    • Audio File libraries are now displayed in a narrow right-hand window
    • The currently selected AudioClip/AudioObject can be locked separately from Unity's built-in inspector locks. You can use this to have an in-editor music player!
  • Finished implementing the Video Volume sample
  • Improved usability of VideoPlayerVolume component
  • Added Unity 2019 compatibility to JSAMPaths, JSAM should be usable in Unity 2019 again

Minor Changes

  • Updated the names of template objects in the GameObject right-click dialogue
  • Some Audio File Wizard settings now persist between closing/re-opening of the tool window
  • Added a default Voice preset
  • Added some additional feedback after the JSAMSettings asset is created
  • Fixed the wording of the JSAMSettings generation dialogue
  • The JSAMStartupWindow now accurately reports the current package version
  • The "Reset to Default" button in the JSAM Project Settings now resets some settings, more reset buttons will be added down the road

Fixes

  • Fixed null reference that sometimes occurs when audio playback ends
  • Fixed PlayMusic not actually using the mainMusic parameter
  • Fixed MusicChannelHelper not Stopping playback properly, leading to unpredictable behaviour
  • Fixed Music Zones not responding to Music volume changes properly
  • Fixed JSAM-related paths in the Project Settings not saving properly
Simple-Unity-Audio-Manager - 3.0 Alpha Release

Published by jackyyang09 over 1 year ago

Finally putting together a new package since JSAM 3 is approaching a production-ready state. No documentation just yet, but the new API is well-commented and there are Example scenes you can explore.

I do not recommend upgrading an existing project from JSAM 2 to 3 as a lot of script names have changed and so most of your references will break and Sound/Music File Objects will have to be re-created.

Remember to check out the new Audio File Wizard to help convert all your AudioClips into Sound/Music File Objects!

Below is a (non-exhaustive) list of changes

Changes

  • AudioFileMusic/AudioFileObjects are now called MusicFileObject/SoundFileObject respectively
  • Added StopSoundIfPlaying and StopSoundIfLooping
  • Added many many static methods to AudioManager as shorthands for commonly used API
    • ie. PlaySound, PlayMusic
  • Expanded usability of Sound/Music File Objects
    • You can pass Sound/Music File Objects into AudioManager.Play
    • Added a .Play() shorthand to Sound/Music File Objects
    • File Objects can be used in most helper components (AudioEvents, SoundPlayer, MusicPlayer etc.)
  • Added Max Playing Instance property to define the maximum number of a specific sound to be played at once.
  • Added support for AudioMixers
  • Added new Static Events to AudioManager component
    • OnAudioManagerInitialized
    • OnSoundPlayed, OnMusicPlayed
    • OnMasterVolumeChanged, OnMusicVolumeChanged, OnSoundVolumeChanged
  • Audio Libraries are now a ScriptableObject. You can share them between different AudioManager instances or even between projects
  • Added AudioFileWizard to allow mass conversion of many AudioClip assets to Sound/Music File Objects.
    • Accessible via Window -> JSAM -> Audio File Wizard
  • Added VideoPlayerVolume component.
    • Add it next to a VideoPlayer component to have the VideoPlayer conform with JSAM's volume settings
  • AudioMusicZones now supports having multiple different zones play the same sound
  • Moved AudioManager settings into ProjectSettings
  • Changed AudioChannel instantiation to use default AudioSource components and to be created during runtime without supplying a prefab.
    • A prefab override for Sound/Music channels can be specified by the user in the ProjectSettings
  • Abbreviated main package folder to JSAM
  • Removed File Library mode from Sound File Objects, all AudioClips are now stored in a "Files" array
  • Removed 3D music as a separate music type. Music can now be spatialized
  • Removed PlaySoundLoop invocation, looping property is now specified in SoundFileObjects
  • Moved most properties from AudioPlayer and AudioPlayerMusic to their respective Audio File Objects
  • Capitalized the instance in AudioManager.Instance
  • Adjusted the font size of Quick Reference Guide text, font size can be adjusted in the Project Settings
  • Removed "Category" dropdown from Audio File object inspector
  • Removed "Audio File Object" label and name fields from Audio File object inspectors, now use the name of the ScriptableObject
  • Added warning beneath Audio Playback Preview window to disable the "mute audio" option in the Game View to preview audio
  • Added a lot more useful logging

Fixes

  • Fixed Audio Particles making no distinction between playing on Particle emit and death
  • Fixed double-clicking an asset to open the audio in the AudioPlayer not re-rendering the audio waveform
  • Fixed sounds rarely cutting each off when a Sound marked as Spam priority was being played constantly
  • Fixed Audio Music Zone continuing to play after switching scenes
Simple-Unity-Audio-Manager - Playback Tool Fixes

Published by jackyyang09 almost 4 years ago

The fastest new release in the West

Bug Fixes

  • Fixed AudioPlaybackTool not updating the waveform when you manually play a different AudioClip in the AudioFileObject's library
  • Fixed AudioPlaybackTool throwing an error when you wanted to preview an AudioFileObject in library mode but has it's non-library AudioClip field empty
  • Fixed AudioPlaybackTool throwing an error when trying to preview an Audio Object with no AudioClips
  • Hid some in-development features that snuck through in the previous build
Simple-Unity-Audio-Manager - Minor Fix

Published by jackyyang09 almost 4 years ago

October has been a real busy month, but if there are things to fix then they need to be fixed!

Bug Fix

  • Fixed Audio File Objects and Audio File Music Objects throwing an error in cases where an AudioManager wasn't present and/or no enums were generated.
Simple-Unity-Audio-Manager - Some More Bug Fixes

Published by jackyyang09 almost 4 years ago

Been quite busy lately so not many new features just yet

Minor Changes

  • Changed the way AudioManager validates the Audio Files path, when a path that doesn't contain the Assets folder is entered, reverts to the last path entered. Paths that do not exist stay in the field in case the user wants to will them into existence

Bug Fixes

  • Fixed Audio File Objects not making use of the "starting pitch" parameter
  • Fixed Audio File Object names not properly updating in the inspector immediately after being changed
  • Fixed a layout group error being thrown when cancelling an Audio Object's creation
Simple-Unity-Audio-Manager - More Bug Fixes

Published by jackyyang09 about 4 years ago

Been quite busy lately so not many new features just yet

Bug Fixes

  • Fixed AudioPlayers displaying an error in the inspector when such an error doesn't exist
  • Fixed AudioPlayerMusic components retaining deprecated logic
Simple-Unity-Audio-Manager - Some Bug Fixes

Published by jackyyang09 about 4 years ago

Bug Fixes

  • Fixed helper components displacing their audio references when elements in the audio library change
  • Fixed renaming Audio File Objects not updating the inspector details immediately
  • Fixed enum generation allowing letters in the first position of a enum name
Simple-Unity-Audio-Manager - Minor Addition

Published by jackyyang09 about 4 years ago

Major Changes

  • Added an in-editor Playback Tool that can be opened in a separate editor window.
    • Can be launched from the toolbar under Window/JSAM/JSAM Playback Tool as well as by double-clicking AudioFile .asset objects
    • Functions as a blown-up version of the Playback Preview shown in the AudioFile .asset objects
    • Waveform preview can be zoomed into to assist in precise playback

Minor Changes

  • Replaced Audio Library right-click dialogue with "Copy" button in AudioManager.
    • The introduction of new right-click dialogs in Unity 2020 renders the previous copy shortcut incompatible
  • Added Audio Music Zone as an option to the Add Component menu

Bug Fixes

  • Fixed StopLoopingSoundByEnum in AudioEvents always stopping a sound immediately
  • Fixed Audio Feedback component settings not updating after changing sound properties
  • Fixed AudioPlaybackPreview automatically playing audio in Play Mode
  • Fixed AudioManager not removing duplicates of itself when DontDestroyOnLoad is enabled
  • Fixed playback scrubbing not working when Audio File Music Object has it's loop mode set to "Loop With Loop Points" has "ClampBetweenLoopPoints" enabled
  • Fixed bug in the "time" loop point tool where numbers would infinitely round up
  • Fixed Loop Start/End points not actually fixing themselves if JSAM detects the end point is below the start point
Simple-Unity-Audio-Manager - Minor Patch

Published by jackyyang09 about 4 years ago

Turns out there were still bugs. This release does away with the ones that have come to my attention. As always, if there are more to be fixed, do toss a quick blurb in the issues page!

By the way, JSAM is now published on the Unity Asset Store! Getting packages live onto the asset store does take a little while though, check back to this page if you're looking for hot-fixes as always.

Minor Changes

  • Audio Music Files now reset their loop point positions automatically if their start and end positions are 0
  • Added additional resources to the AudioManager Quick Reference Guide dropdown
  • Streamlined some editor code to make use of inheritance more, you may find the file-size has dropped a tiny bit

Bug Fixes

  • Fixed not being able to enter values below 100 in the milliseconds field when changing loop point settings with the Time tool
  • Fixed an AudioMusicZone error label in the inspector not going away properly after resolving it's issues
  • Fixed Audio Playback Preview waveform rendering somewhat incorrectly
  • Fixed enums throwing an error by including dashes in script
  • Fixed AudioTriggerFeedback not doing any layer comparison checks
Simple-Unity-Audio-Manager - Version 2.0.0!

Published by jackyyang09 about 4 years ago

Here it is! After about half a year in development, JSAM has been revamped to be super user-friendly, sporting an upgraded interface, and a completely changed back-end! And right at 200 commits too!

Here's a quick link to download so you don't have to scroll all the way down the patch notes.

Major Updates

  • AudioManager now loads Audio Files from ScriptableObjects rather than GameObjects, no more rampant copy+pasting across scenes and AudioManager persistence is now optional!
  • JSAM will now generate a series of Enums when referring to Audio Files in script, allowing for easy code-prediction compared to the guessing game of dictionary key strings!
  • JSAM now includes an upgraded suite of tools for authoring loop points (supported by ATL .NET), no need for third-party software when it can all be done without leaving Unity
  • Audio Files now support per sound fading, you can edit the settings for fading-in and fading-out sounds with the new Fade Tools
  • When TimeScaledSounds is set to true in AudioManager, JSAM will change the pitch of all sounds and music to be relative to Time.timeScale.
    • All Audio Files now have an option to "Ignore Timescale"
  • Added support to add Unity's built-in Audio effects to Audio Files as well as options to ignore said effects
  • New AudioMusicZone component that creates spatialized music bubbles in the scene that play a specific music track when the AudioListener enters the bubbles.
    • PlayMusic3D and similar methods will be deprecated and replaced with their introduction
  • Added relative volume option to Audio Files so that volume of individual audio can be tweaked
  • Upgraded the Audio Library view in the AudioManager component
    • Audio Files can now be assigned categories for better organization in the Library view
  • Revamped almost every component in the inspector

Minor Updates

  • Added new volume controls to AudioManager component
  • Audio Files now have an option to play themselves backwards during runtime
  • Added JSAM components to the right-click dialog in the hierarchy window and GameObject drop-down.
  • Added custom listener distance falloff to Audio Files
  • Added additional trigger events to AudioCollisionFeedback and AudioTriggerFeedback
  • Added overload of PlaySound that takes a Vector3 position to spatialize sound rather than a Transform
  • Moved the Loop option from regular Audio Files to the AudioPlayer
    • Looping sounds now also change pitch and sound played each loop iteration
    • Added option to never loop the same AudioClip twice in a row if Audio File is using a library
  • Added additional StartingPitch property to Audio Files
  • Pitch shifting is now defined through floats rather than arbitrarily assigned enums and can now be set directly in the Audio File
  • AudioChannel prefab will now reconnect it's reference to AudioManager if it gets disconnected somehow, will also recreate itself if the prefab goes missing
  • Removed special overloaded versions of PlaySound and PlayMusic
    • Removed overloads that had custom AudioClips as parameters AudioManager.
  • Fixed AudioManager not properly removing/setting it's singleton reference on construction/destruction (for the last time I hope)
  • Improved in-code documentation and optimized some functions, cleaned out deprecated code in AudioManager

Bug-Fixes

  • Edits to the BPM field in AudioFileMusic's loop point tools can now be undo'd and redo'd
  • Removed AudioClipPropertyDrawer since important AudioUtil functions have been removed in Unity 2020
  • Fixed some inspector elements not getting drawn properly in different version of the Unity Editor
  • Fixed the BaseAudioFeedback component being visible in the AddComponent menu
  • Fixed Audio Files not properly rendering the waveform in the playback preview
  • Fixed sounds not spatializing immediately on Start
  • Fixed GetAvailableSource() not returning the newly generated AudioSource when Dynamic Source Allocation is set to true
  • Fixed AudioManager spawning other objects that share the name "Manager" when being added through the right-click dialog
  • Fixed AudioCollisionFeedback so it plays at the point of collision rather than the pivot of the GameObject its attached to
  • Fixed Low and High priority levels having their actual values switched
Simple-Unity-Audio-Manager - Version 2 Early Alpha

Published by jackyyang09 over 4 years ago

This is an insane release
After about half a year in development, JSAM has been revamped to be super user-friendly, sporting an upgraded interface, and using scriptable objects rather than in-scene GameObjects.

A full changelog will follow in the next post once I've ironed out as many issues as I can. For now anyone interested is free to download an early, maybe buggy, version of JSAM 2.0

Anyone upgrading from a previous version of JSAM are strongly recommended to delete their previous package folder before importing this one!

Remember to report any bugs or suggestions to the issues page! I won't be able to fix them if I don't know about them after all.

Simple-Unity-Audio-Manager - Quick Fix

Published by jackyyang09 over 4 years ago

Wow I don't do enough testing it seems

Minor Update

  • Audio Manager and Audio Channel objects now have a space between their name
  • Updated folder name to reflect the actual plugin
  • Audio Manager will solve for instances where your library has spaces with missing sounds by skipping over them
  • Audio Manager will automatically select itself after being instantiated through the context menu

Bugs Fixed

  • Fixed an error when trying to add a new Audio Manager through the context menu
  • Fixed an error when enabling library usage on a new fresh sound
  • Fixed the Audio File component reporting that you need to add a sound when the library and not the single file
  • Fixed StopSound never actually stopping the sound when passed sounds in by audio name
  • Fixed a case where Audio Manager kept trying to kill itself outside of play mode
  • Fixed AudioPlayer not updating it's Audio list properly
  • Fixed AudioManager shooting an error when it prematurely gives up finding an Audio Listener
Simple-Unity-Audio-Manager - Major Updates

Published by jackyyang09 over 4 years ago

Major Additions

  • Added the ability to add a new instance of AudioManager to the scene
    • Can be done by right-clicking in the hierarchy, hovering over Audio and selecting Audio Manager
  • Audio Files can now be set to use libraries so that multiple sounds can be associated with the same name
    • You can enable libraries by ticking the Use Library box in the Audio File
    • The First-Person 3D example scene has an example of sound library usage in action
  • Reorganized the AudioManager component's various options for better usability (many options can be found by enabling Advanced Settings)
  • Added LoopModes as a parameter in PlayMusic()
    • LoopMode will replace the useLoopPoints and loop boolean parameters and combines the two, this is also reflected in AudioPlayerMusic components
  • A public Trello board has been added to the ReadMe.md so changes can be better documented and upcoming features/changes can be viewed by anyone interested

Minor Additions

  • Adding a new audio file immediately prompts you to change the file's name
  • Dynamic Source Allocation is now enabled by default
  • Added an option to disable AudioManager outputs
  • Audio File Music will hide it's more complex settings when no Audio File is present
  • Time based loop point input has been made more stable
    • Numbers in the seconds field will not exceed 59
    • Numbers in the milliseconds field can be made more precise and will not affect the seconds
  • To save performance, the in-inspector audio previewer will no longer show waveform previews when the audio being previewed exceeds 30 seconds
  • Every Audio related component now supports multi-editting
  • Audio Manager will now try to locate an Audio Listener in OnValidate()
  • Improved documentation on how Pitches work
  • Hid all m_Script fields from Audio related components to make things clean
  • Removed some long deprecated code from AudioManager

Bug Fixes

  • Disabling loop point tools in Audio File Music no longer breaks the dropdown
  • Audio Players set to stop audio when they're destroyed no longer breaks when they were disabled at instantiation
  • Fixed Audio Manager playing music in a broken way when music file has loop points set but disabled
  • Mostly fixed many cases where Audio Manager will try to kill itself on scene load/reload
  • Fixed looping audio spatializing itself when Audio Manager has spatialization disabled
Simple-Unity-Audio-Manager - Minor fixes for the last major update

Published by jackyyang09 almost 5 years ago

Updates

  • Fixed Audio dictionaries not properly regenerating when you edit their names
  • Fixed a rare case where the AudioManager singleton may not actually exist in the current scene
Simple-Unity-Audio-Manager - Actually A Really Big Update

Published by jackyyang09 almost 5 years ago

Updates

  • Made AudioManager nicer to look at in inspector
  • Added dedicated buttons to add sound and music files
  • Fixed Dynamic Source Allocation not working
  • Added additional documentation in AudioManager.cs where there previously was none
  • Fixed music player in AudioFileMusic not updating properly when scrubbing while paused
  • Added a sample standalone volume control prefab for free use
  • Made things more stable in general