wav: Refactor the tag checking into a switch statement