Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by MichaeA · Apr 27, 2018 at 03:54 PM · audiosourcedelayaudiolistenersound effects

Speed of sound delay adjustment

Hi, I'm working on a project that involves a moving object emitting a noise, to be heard by a stationary observer. When an object is moving and emitting sound, there is a Doppler shift, which Unity handles. But there is also a delay in when the sound that it produces hits your ears. This happens with every sound, but is most obvious at far distances and high speeds. If you've ever been to an airshow, you'll be familiar with what I'm trying to replicate. The sound of the aircraft seems to come from the location where it was moments before because the image of the aircraft moves faster than the sound does.

I've seen Answer threads about a stationary sound, like an explosion or a gunshot propagating forward, which would only require an AudioSource.PlayDelayed() call, but I don't think that would help me as starting and stopping the sound every game update would add a choppy noise and the delay needs to shift every update based on the new location of the object.

I'm able to find the delay in time very easily with the magnitude of the vector between object and listener and the speed of sound, but I'm having trouble applying this to the Audio. What I had in mind was an audio delay that continually updated with the object's location. I've noticed in the scripting reference and manual that there used to be an Audio Mixer effect that was a simple delay, but I don't see that in my version of Unity (5.6.3f1). Any ideas?

Comment
Add comment
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 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by MichaeA · Apr 30, 2018 at 12:48 PM

So this morning I realized I could get the AudioSource to come from the right location by simply lagging the source behind the game object in space so that the sound would appear to come from where the object was. However, this still doesn't change the sound to be the same as what it was X seconds ago. Which I still will need to figure out for it to sound right.

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 MichaeA · Apr 30, 2018 at 07:04 PM 0
Share

Finally got it. To fix the rest of this issue, I attached and Audio Echo Filter with the delay modulated by vector magnitude between source and listener. The rest of the settings are to have DecayRatio = 0, Wet$$anonymous$$ix = 1, Dry$$anonymous$$ix = 0.

DecayRatio(0) makes the echo repeat only once. Wet$$anonymous$$ix(1) makes the echo at full volume. Dry$$anonymous$$ix(0) eli$$anonymous$$ates the original sound, leaving only the Echo, which is delayed by the modulated delay.

With the AudioSource shifted backwards from the visual object, and the sound actively delayed by the filter, it appears quite a bit closer to real life.

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

83 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 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 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

Optimised audio system design for mobile 0 Answers

Pitch changes when i get closer to object with audio source 1 Answer

Dolby Surround - Stereo - 3d Sound with Audio Source and Listener 0 Answers

Audio source emits sounds from another audio listener? 0 Answers

Need help with 3d sound 2 Answers


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