• 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
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
Necronomicron

People who like this

1 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.

14 Replies

· Add your reply
  • Sort: 
avatar image

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
DenisM
OreoSplitter
jmaslaki
seanmor96
RichToTheArdYo
IGKUSH
MoleratDigital
Gwynbleidd_27

People who like this

8 Show 2 · 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 Gwynbleidd_27 · May 24, 2021 at 08:18 AM 0
Share

Thank you! changing in to "Streaming" fixed it for me! <3

avatar image

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
Artuhorn
Sludgemonster
THE-PCProgramer
danielmanzie87
abotrix

People who like this

5 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 danielmanzie87 · Aug 27, 2021 at 06:46 PM 0
Share

This worked for me. Thanks.

avatar image

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
slims
achimmihca
arodriguez7

People who like this

3 Show 0 · 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

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
Sphynxe
cobertos
Necronomicron

People who like this

3 Show 0 · 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

Answer by LeeLorenzSr · Dec 19, 2020 at 04:13 PM

I just had this problem. I switched up some audio to use 3D (It's a 2D shooter) and I wanted more spatial awareness in my clips. I drop recyclable objects for explosions and audio, and after switching to 3D, I got clicks. This mostly happened on recycling the pooled object... for my situation, it ended up being a timing issue... delaying the playback until into the second Update call solved the issue nicely. Since the 3D call depends on the placement of the gameobject, and a rapid change in that position can skew the playback, I suspect that was resulting in the click. TL;DR version... Delay playing the clip back on 3D audio until position has been established.

Comment
gotiobg

People who like this

1 Show 0 · 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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

26 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

Related Questions

Buzzing sound in Everyplay recording! 1 Answer

Ubuntu 16.04 No audio 1 Answer

how to play audio in animation track in timeline? 0 Answers

Quick Audio Question - Trying to add sound to gun 2 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