Imam Muslim (Allah be pleased with him) relates in his Sahih via Abu Hurayra (Allah be pleased with him) that the Messenger of Allah (Allah bless him and give him peace) said, “When one of you senses something in his stomach and is confused whether or not something exited, then let him not leave the masjid until he hears a noise or smells an odour.”
Imam Nawawi mentions in his commentary on Sahih Muslim that “until he hears a noise or smells an odour” means that one knows that one of the two has taken place, and that there is consensus among Muslims that actual hearing or smelling is not necessary (Nawawi, Sharh Sahih Muslim (Dar al-Ma’rifa), 3-4.273). This hadith is one of the sources of the important maxim of Sacred Law, “certainty is not removed by doubt.”
The way that this hadith applies to your situation is as follows:
(1) If you are certain that you have passed wind, your wudu is invalidated whether or not you hear or smell something. Being in a state of wudu is condition for the validity of prayer. Hence your prayer is also invalidated. The fuqaha mention that to engage in an invalid act of worship is forbidden (al-talabbus bi’l-‘ibada al-fasida haram). One of the implications of this rule is that if one breaks one’s wudu, it becomes impermissible for him to continue “praying”. It is obligatory for such a person to immediately cease praying. It would not be permissible to continue to pray out of embarrassment over what other people would think. A method recommended by scholars is to immediately grip one’s nose as if one has a nosebleed and then to leave the prayer to re-perform one’s wudu. This way, people will think that one’s nose is bleeding and will not harbour bad thoughts regarding one.
(2) If you doubt whether or not you passed wind, your wudu is assumed to be valid, in accordance with the general principle that “certainty is not removed by doubt.” Imam Nawawi mentions in his commentary on the above hadith: “Our companions have said that there is no difference regarding doubt whether it is equally likely that one does or does not have wudu, or whether one of the two possibilities is more likely, or whether one is almost certain of one of the two possibilities: in every case, performing wudu is not necessary” (Nawawi, Sharh Sahih Muslim (Dar al-Ma’rifa), 3-4.273). As long as you don’t reach complete certainty that you have passed wind, you should discard your doubts and continue praying.
And Allah knows best.