• 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 /
  • Help Room /
avatar image
1
Question by Kiloblargh · Aug 11, 2017 at 07:32 AM · audiosoundglitchclicking

What causes the audio clicking & how do I get a clean sound?

I have two sounds that I'm triggering about twice a second, one for each player, for an old-arcade-style movement noise (wakka wakka wakka bloit bloit bloit...) using PlayClipAtPoint. They're just uncompressed AIFFs and there's no other sound going on yet. I get this intermittent "thwip...thwip" glitch at random times every few seconds that sounds like a loose speaker connection. I'm getting over 100fps so the CPU can't be struggling.

I thought it could be a problem trying to play the sound before the last one had finished so I made two AudioSources for each player and alternated which one played sound each time; that didn't seem to make any difference. Any other ideas?

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 Kiloblargh · Jan 06, 2013 at 09:13 PM 0
Share

I found out that the problem is definitely in the 3d sound playback. It goes away if I only have Player1's AudioSource using "PlayOneShot" and Player2's using "PlayClipAtPoint" which I decided is the way I want it to work anyway. So my specific problem is solved, but not my general one. So what's up with multiple PlayClipAtPoint calls not playing nice with each other- has anyone else who had that "thwipping" figured out what to do to avoid it?

avatar image asafsitner · Jan 06, 2013 at 10:20 PM 1
Share

You may want to check your sound files in a DAW or wave-editing software to make sure there's no clipping (i.e. values that go above 0db).

You'll also want to make sure the file begins and ends at 0 (not 0db mind you, but a flat wave value). If the wave is cut in the middle it will cause pops and crackles.

11 Replies

· Add your reply
  • Sort: 
avatar image
7

Answer by kubajs · Feb 10, 2016 at 05:33 PM

I had the same issue with PCM compression format. When I chaneged "Load Type" to "Streaming", problem was solved. "Compressed in memory" or "Decompress on load" was causing the clicking sounds. Also Compression format ADPCM or Vorbis worked for me,

This can be set directly in Inspector in Unity when clicking on audio file.

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 jmaslaki · Nov 24, 2019 at 12:31 PM 0
Share

thank you!

avatar image
3

Answer by Abram-Painter · Jun 06, 2016 at 07:47 PM

Go to ProjectSettings>Audio and set the DSP buffer size to best performance. it works.

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
3

Answer by r2r313 · Aug 11, 2017 at 06:52 AM

I realize this is an old thread but I wanted to share how I solved this issue. I had a similar problem with some audio clips I had and the fixes listed here did not work for me. I solved my issue by exporting at a higher bitrate. Originally they were 44100 (Hz) but changing to 48000 (Hz) and exporting as a .wav file solved the clicking noise issue.

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
3

Answer by rh_galaxy · Feb 08, 2019 at 06:19 PM

The clicking comes from not starting or ending at a zero sample... and when shutting off a looping sound or any sound anywhere before the end, you could do the fade out your self like this

 AudioSource oASEngine;
 bool bEngineFadeOut = false;
 ...
 
 void Start()
 {
     ...
     foreach (AudioSource aSource in GetComponents<AudioSource>()) {
         if (aSource.clip!=null && aSource.clip.name.Equals("engine"))
             oASEngine = aSource;
         else ...
     }
 }
 
 void FixedUpdate()
 {
     ...
     if (startEngine) {
         bEngineFadeOut = false;
         oASEngine.volume = 1.0f;
         oASEngine.Play();
     } else if(stopEngine) {
         //oASEngine.Pause(); //don't, this may cause clicking noise
         bEngineFadeOut = true;
     }
     if(bEngineFadeOut)
         oASEngine.volume *= 0.8f; //fade out over ~100-200 ms
 }
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 Fajardo · Jan 07, 2013 at 07:21 PM

When it goes to audio, always do a double check in a DAW before exporting to an Engine. It's very important to find out where the problem is. Sometimes it's a problem with the sound wave.

First of all, try looping one of the sounds all alone. Since you are using an uncompressed AIFF sound there won't be a looping problem. Them do the same with the second one.

Second, try adding some silence to the end of the clip. Since you are using two Audio Sources it won't cause gaps between sounds

Third, you can try getting the sound exported in other formats, like .mp3 and .wav.

I hope one of this solutions solves your problem.

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
  • 3
  • ›

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 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

Related Questions

Buzzing sound in Everyplay recording! 1 Answer

Ubuntu 16.04 No audio 1 Answer

How Do I Make A Rising Piano Death Noise? 1 Answer

Having problem in turning on/off the sound when going to another scene and going back to menu 0 Answers

How to script shooting to trigger shooting sound 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