Im having a problem with the audio im using with my game. I want it so that when a certain action occurs a heartbeat sound will start to play but when this happens the sound is all distorted. When i play the audio in the inspector it actually sounds like a heartbeat but when I play the game it sounds really deep and off.
2 Answers
2So I figured out my problem it was that I was using an if statement that checked a number and if that number was over 1000 it played the audioclip. The problem was that it was doing this in the update function and it was continually replaying the sound causing it to play over itself numerous times and sound distorted. I fixed it by checking a boolean to see whether or not the sound was playing
doesn’t sure what is your problem here, but maybe u could try this? Audio Manager
Yeah i looked at that, doesnt seem to help my problem though
– AyooNistoHmm... Are you perhaps playing the sound on an audiosource who's pitch is changed? Even if you use PlayOneShot, the pitch of that clip will change while it's playing
– Josh707EDIT So I figured out my problem was that I was using an if statement that checked a number and if that number was over 1000 it played the audioclip. The problem was taht was doing this in the update function and it was continually replaying the sound causing it to sound distorted. I fixed it by checking a boolean to see whether or not the sound was playing Im not sure, when i attach my sounde directly to the audiosource it plays fine but when I have it play programatically is when it starts to sound off
– AyooNistoOh, weird. I'm out of ideas! :P
– Josh707have u try another sound files type? if the problem persist then the problem will be the settings of the audio I would recommend to change your "Pan Level" to zero or u could try to turn off doppler effect. And see if the problem persist..
– Rgalaxy