Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sound cutting and breaking problem

Discussion in 'Audio & Video' started by icarotkd, May 27, 2016.

  1. icarotkd

    icarotkd

    Joined:
    Sep 29, 2015
    Posts:
    16
    I'm having a pretty weird problem.
    The weapons in the game im making have some pretty high firerate, but the sound is breaking, and i've no ideia why, any guesses?

    Here's a video, the sound break is pretty noticible, and when it happens, it stops all sounds from the game, not only the gunshot sounds, and they're back shortly after.

     
  2. michaelhartung

    michaelhartung

    Joined:
    Dec 19, 2013
    Posts:
    72
    Do you get any console warnings regarding the voice count?
     
    icarotkd likes this.
  3. icarotkd

    icarotkd

    Joined:
    Sep 29, 2015
    Posts:
    16
    No, I dont get any warnings or errors, strangely enough...
    Sorry, should've said that from the beggining

     
  4. rorywalsh

    rorywalsh

    Joined:
    Apr 10, 2015
    Posts:
    114
    How are you triggering the sounds? And are you triggering each gun shot sound individually? A more efficient approach might be to replace multiple calls to the audio system with a single call. So either loop the gunshot sample for as long as the firing is taking place, or create a longer file that contains X number of gunshots. Then simply trigger this to play for as long as the firing is taking place. Just an idea.
     
    icarotkd likes this.
  5. icarotkd

    icarotkd

    Joined:
    Sep 29, 2015
    Posts:
    16
    Yup, they're individual, But unfortunately that wouldnt really work very well, because the shots need to be individual, otherwise the sound will keep playing after i stop shooting, and doing the loop thing, that would be too much to do per each weapon (not even saying about how much work it would be putting them togheter on a mp3 file), and there's 50+ of them, and it would also need to be perfect, the sound would have to sound natural which wouldnt be for sure...But I apreciate the ideia...
     
  6. rorywalsh

    rorywalsh

    Joined:
    Apr 10, 2015
    Posts:
    114
    Why? What's stopping you from stopping playback once you are done shooting?

    No problem. I'm afraid all I have are ideas! Can you slow down the triggering of the samples, or have you already? It seems to be that you are just triggering far too many sounds per second which is naturally going to cause some issues.

    Another idea, maybe you could use multiple AudioSource's to play back the sounds? In that case each would be firing off level sounds per second, but the overall effect might be the same?
     
    icarotkd likes this.
  7. icarotkd

    icarotkd

    Joined:
    Sep 29, 2015
    Posts:
    16
    Well, its fixed
    I just Set the audio clip just once and used playoneshot without setting valum scale
    But thanks for the help man, apreciate it
     
  8. rorywalsh

    rorywalsh

    Joined:
    Apr 10, 2015
    Posts:
    114
    Nice one. Glad you got it sorted.