The Gemora states that a Heavenly voice declared that the halachah follows the opinion of Rabbi Eliezer.
The Gemora cites the opinion of Rabbi Yehoshua: He maintains that we do not pay attention to a Heavenly voice dictating who the halachah should follow.
The Gemora in Yevamos (122a) states: A woman can get married on account of a heavenly voice. This means that if her husband went overseas and a Heavenly voice declares that her husband died, she is permitted to get married.
The Tosfos Yom Tov states that this is not referring to a Heavenly voice since we rule that one does not pay halachic attention to a voice emanating from heaven.
Reb Elchonon explains differently: We do not pay attention to a Heavenly voice regarding halachic matters because Torah is not in the heavens; it was given to human beings. The Sages of Klal Yisroel have the authority to resolve all halachic matters, not the heavens. However, a Heavenly voice can resolve a factual doubt. We would not rely on a Heavenly voice in regards to something that requires two witnesses. The Chachamim were lenient in regards to the testimony of a woman and they relied on the words of even one witness; that is why a Heavenly voice can be believed in this matter.