Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

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.

During early concept we wanted to implement a binary control and have stricter timing to make gameplay match a rhythm play style. We thought about making a simpler control with just sound/no sound, but we decided to move on from that idea, because it simplified the gameplay a bit too much, and used cross-correlational analysis of breath spectra to try to implement out initial idea of detecting breaths themselves, which isn't perfect at the moment but with some fine tuning can be marginally improved :)