In the LoadContent method:
soundEffect = Content.Load<SoundEffect>("r3");
soundEffectInstance = soundEffect.CreateInstance();
soundEffectInstance.IsLooped = true;
In the Update method:
if (Keyboard.GetState().IsKeyDown(Keys.D1) && soundEffectInstance.State == SoundState.Stopped)
if (Keyboard.GetState().IsKeyDown(Keys.D2) && soundEffectInstance.State == SoundState.Playing)
Exactly when the instance is stopped, the "click" (or I should say "tick") noise occurs. I don't think it's a question of code but of how the wave that produces the sound is made, since not all the sound effects I downloaded from the internet have the same issue.
As I said, if I do:
soundEffectInstance.Volume = 0;
the "click" doesn't occur, but I don't want to use such a solution.