Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
10
Question by boddole · Apr 06, 2014 at 11:06 PM · audioaudiosourcerolloff

Audio Source Volume not Fading Over Distance

Hello everyone, I'm encountering a problem where I can still here a sound being played at full volume even though I am well outside of the audio source's maximum range (see in the pic my player is in the top left, and the sound source is in the bottom right). I have tried making the range of the audio source and changed its roll-off, nothing changes, the should it plays is audible at 100% volume no matter where the player is.

If anyone has an idea as to why this is happening, I would love to know.

Other Notes:

I only have 1 audio listen in the scene (attached to the camera on the player) -> the error message in the console exists because for 1 frame when the level loads additive, there are 2 camera in the scene.

The audio clip is forced to mono (changing this option seems to make no difference)

alt text

audioproblem.jpg (298.9 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Simon-Larsen · Apr 06, 2014 at 11:17 PM 1
Share

https://docs.unity3d.com/Documentation/Components/class-AudioSource.html Increase the 3d Pan Level

avatar image boddole · Apr 06, 2014 at 11:43 PM 0
Share

I see, however, this causes a new problem: see$$anonymous$$gly the only way to get audio to completely fade is to set 3D Pan to 1.0, however at 1.0 the audio gets way too specific (turning left or right completely shuts off audio from one side or the other). You can reduce pan, but then the audio never entirely fades out.

-Is there a way to deal with this? I'm using spread angle @ 180 degrees and it seems to work, but I'm wondering if there are any potential problems or draw backs to doing this.

6 Replies

· Add your reply
  • Sort: 
avatar image
35

Answer by AfroDieter · Sep 28, 2015 at 06:28 AM

Kind of a late reply but for whatevery reason this has to do with the "Spatial Blend" slider. Just set it to 1 and you will have it as you intended.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheRedGuy90 · Sep 18, 2016 at 07:29 PM 1
Share

Hi.

I just came across this post.

setting the Spatial Blend to 1 did stop my 2nd source from being heard everywhere, but now I cannot hear it at all, even when I am right next to it.

avatar image sebasvanhalewijn · Mar 06, 2020 at 09:14 PM 0
Share

Sadly incorrect...

avatar image Omti1990 · Nov 20, 2020 at 09:55 PM 0
Share

It did work for me. $$anonymous$$aybe you also need to change "Volume Rolloff" to "Linear Rolloff"? The standard "Logarithmic Rolloff" is insanely punishing if you look at the graph.

avatar image develobba · Dec 29, 2020 at 12:49 PM 0
Share

This was the piece, which i was missing. Thank you!

avatar image
6

Answer by Dabwam · Dec 14, 2016 at 08:32 PM

@TheRedGuy90 Not sure if you still have this problem, but I thought I'd post it anyways. Try setting the maximum distance to 30 or something and the minimum distance to 1, this worked for me along with setting the spatial blend to 1.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheRedGuy90 · Dec 14, 2016 at 09:43 PM 0
Share

I actually am still having trouble; I'll try this out. Thank you.

avatar image
1

Answer by achest · Jan 31, 2017 at 04:49 PM

AudioSource.SpatialBlend = 1f;

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Superbhaley · Apr 02, 2017 at 09:54 AM

Well this is not what you'd call an answer but I had too had also set the Spatial Blender to 1, the minimum distance to 1, and the maximum distance to 30 and I still have the Audio Fade problem so some1 please help me out as soon as possible I really need it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mitaywalle · Sep 13, 2017 at 10:22 PM

You can use SpatialBlend (2D => 3D) this way, closer - mean more 2D, far - more 3D.

This gives you effect '2D AudioSource affect by min and max Distance'

 using UnityEngine;
 
 public class spatialFader : MonoBehaviour
 {
   private Transform Listener;
   private AudioSource source;
  
   private float sqrMinDist;
   private float sqrMaxDist;
  
   void Start()
   {
     Listener = FindObjectOfType<AudioListener>();
     source = GetComponent<AudioSource>();
     if (!source) return;
  
     sqrMinDist = source.minDistance * source.minDistance;
     sqrMaxDist = source.maxDistance * source.maxDistance;
   }
 
   void Update()
   {
     if (!source || Listener) return;
     var t = (transform.position - Listener.position);
     t = (t*t  - sqrMinDist) / (sqrMaxDist - sqrMinDist);
     source.spatialBlend = Mathf.Lerp(10f,22000f,t);
   }
 }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

30 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WebGL audiosource max distance not working 1 Answer

webgl volume just doesnt work 0 Answers

Hearing audio outside max distance 12 Answers

How to get current volume of an AudioSource. 3 Answers

Max amount of simultaneous, hearable sounds? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges