I think it might be difficult to differentiate between breathing in and out.
One game I played https://itch.io/jam/lv-99-game-jam/rate/2031364?before=4#post-7686909
Did a pretty good job with the voice controls, and I think you could do the same by just...
bool wasAboveLastUpdate = false;
float threshold = "Assign this from player set value with a good default";
void FixedUpdate(){
bool overThreshold = mic.volume > threshold;
if(wasAboveLastUpdate != overThreshold ){
wasAboveLastUpdate = overThreshold;
SwitchLanes();
}
}
This would let the player be able to just make any noise that causes the mic's input volume to go over a threshold to switch lanes, and would require the player to stop making noise / go under the threshold, and then make a noise again over the threshold to switch again.
So it would not keep switching over and over, instead it would just switch every time you make a noise over the threshold, after being quiet and it going under for at least one update.