//walk sound
if (Input.GetButtonDown(“Horizontal”) || Input.GetButtonDown(“Vertical”))
{
//source.PlayOneShot(clip_walk, 1.0f);
source.loop = true;
source.clip = clip_walk;
source.volume = 1.0f;
source.Play();
}
else
{
source.Stop();
}
you need to check whether it is already playing, before trying to play it, because your code is currently trying to start playing the clip every frame the buttons are pressed even if the audiosource is already playing the clip, so you are just starting it over and over again.
if (Input.GetButtonDown("Horizontal") || Input.GetButtonDown("Vertical"))
{
if (!source.IsPlaying)
{
source.loop = true;
source.clip = clip_walk;
source.volume = 1.0f;
source.Play();
}
}
else
{
source.Stop();
}