Question on Audio?

Hi there,
Am doing a runner game. as you know a player is will collect lot no of coins in continuous. I have to play the when the player collecting coins in increment order. not like play sound on collection.
I mean same like subway surfer. first coin sound is less and the next is a bit higher and so on…
how can I do it

public float pitchShiftValue;
public float pitchDefault;
public float pitchMax;

void OnCoinCollect()
{
myAudioSource.PlayOneShot(mySound);
if(myAudioSource.pitch < pitchMax)
{
myAudioSource.pitch += pitchShiftValue;
}
else
{
myAudioSource.pitch = pitchDefault;
}
}