I’m trying to get a looped sound effect to play while holding down a button to charge a projectile like Metroid/Mega Man. I have two different types of projectiles that can be charged, so two different looped clips. Both clips loop fine and sound great when I play them looped in the inspector but when they play in game, they’re both very loud and distorted. Here’s the script:
private AudioSource sound;
public AudioClip blueCharge;
public AudioClip redCharge;
void Awake()
{
sound = GetComponent<AudioSource>();
}
void Update()
{
if (blueCharging)
{
sound.PlayOneShot(blueCharge);
}
else
if (redCharging)
{
sound.PlayOneShot(redCharge);
}
}
The two bools are just bools from another script that tell me what weapon is selected and the button is being held down. The Audio Source is hooked up to a Audio Mixer Output, which I haven’t messed with at all, and no matter if I set Loop to true or false in the inspector, it makes no difference. What could I be doing wrong?