Here, your case is a matter of adultery. Adultery is voluntary sexual intercourse between a married person and a person who is not their spouse. Adultery is extramarital sex that is considered objectionable on social, religious, moral, or legal grounds. As you said, your wife is having an affair, then she is clearly cheating on you.
Before 2018, Section 497 IPC criminalized adultery by imposing culpability on a man who engages in sexual intercourse with another person’s wife. Adultery was punishable with a maximum imprisonment of five years. Women, including consenting parties, were exempted from prosecution.
After much back-and-forth, the 2018 Supreme Court verdict decriminalized Section 497 of the IPC, which criminalised adultery and treated a woman only as her husband’s property, depriving her of the ability to make decisions.
Unfortunately, you can’t take any legal action against her based-on adultery but adultery is still a valid ground for divorce. Before thinking of anything mentioned above, I would suggest you to have a proper communication with your wife first and then take any action.