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
4
Question by Jesse Anders · Oct 12, 2010 at 01:58 AM · distancevolumerolloff

[Unity 3] Logarithmic volume curve

In the AudioSource inspector, changing the distances for rolloff relative to the defaults can result in the logarithmic curve having a 'y' value of significant magnitude at the max distance, which means the sound will stop abruptly when it goes out of range rather than fading out smoothly.

In the inspector you can adjust the curve to match the new distances, but if you modify the distances via scripting, it seems in some cases you'll be stuck with a volume curve that causes the sound to stop abruptly when it goes out of range. Is this correct, or am I missing something?

This may be user error, and in any case it's certainly not that big a deal. But, I just wanted to make sure I wasn't missing anything before implementing a workaround.

Comment
Add comment · Show 1
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 cjmarsh · May 19, 2011 at 06:03 AM 0
Share

Did you ever get your implementation working? If not, an example of the attempt or some kind of problem to solve would be helpful if you'd like an answer on it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jakehawken · Mar 05, 2014 at 04:31 AM

I've been struggling with this exact issue for the last couple days.

I think the problem is that Unity uses amplitude and the human ear hears dB. Amp (the 0 to 1 volume system in Unity) is linear, while dB is logarithmic, so a linear fadeout in amp sounds like an inverse logarithmic curve to our ears.

Converting to dB with math also causes a problem because while Amp has 1 as full volume and 0 as complete silence, dB has 0 as full volume and negative infinity as complete silence (because silence is something that can only be approached asymptotically in dB). So if you're converting to dB, then when Amp hits 0, dB will return -∞, and Unity will throw an error.

I haven't yet solved this problem, so I'll be eagerly following this question.

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

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

1 Person is following this question.

avatar image

Related Questions

Distance Based Volume Attenuation of Stereo Sounds 0 Answers

How to get current volume of an AudioSource. 3 Answers

Detonator and it's volume threshold 0 Answers

Audio mixed, blending on distance ? 1 Answer

Change variable value based on perceived audio volume 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