Skip to content

Suggestion: Add a "Fade" param to PlaySound() / StopSound() #55

Open
@LazyEti

Description

@LazyEti

Hi, I think it would be very useful if it was possible to fade in / out when calling PlaySound() or StopSound().

My suggestion would be to add a float input to each function so they could be called like so:
AudioManager.PlaySound (AudioLibrarySounds.player_slide, fade: .5f);

Also, I'm not sure if this is a bug or user error but I tried using SoundChannelHelper.BeginFadeOut() but it's not doing anything
Ex:

SoundChannelHelper soundRef = null;
   void Update()
   {
       if (Input.GetKeyDown (KeyCode.Alpha6)) 
              soundRef = AudioManager.PlaySound (AudioLibrarySounds.player_slide,transform);

       if (Input.GetKeyDown (KeyCode.Alpha7)) 
              if (soundRef != null)  soundRef.BeginFadeOut (.1f);       
   } 

Unity Version:
6000.0.26f1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions