Sanhedrin 62 - Intent of Sounding and Hearing Shofar
Sanhedrin 62 talks about Eating matzah and maror without intent
המתעסק בחלבים ובעריות חייב
One who is preoccupied in his eating of cheilev or having illicit relations is liable
If the prohibition provides benefit, e.g. eating a prohibited food or having illicit relations, the person is liable since he benefitted from the transgression. Indeed, the Ran (Ran R. Nissim B. Re’uven of Genona: 14th century) answers that since, the obligation of matzah involves eating the mitzvah could be fulfilled even without intent since there is benefit for the one who is eating. By hearing the Shofar, there is no benefit one receives from hearing the Shofar blast. Accordingly, there is no intent nor a benefit.
In contrast, when discussing the laws of Shofar, the Rambam (Maimonides, a famous 11th century commentator and legal systemitizer) and rules that one who blows the shofar while preoccupied does not fulfill the mitzvah. Intent is paramountly necessary. The Mishnah Berurah (updated Code of Jewish Law, 20th century) indicates that not only the Shofar Sounder, but also the Shofar hearer must have the intent to sound and hear the notes of the Shofar respectively. See 589:8. Indeed, the glosses in this chapter indicate that someone who practices the shofar does not fulfill the mitzvah due to lack on intent. Further, if someone who walks on the road and does not intend to hear the sounds of the Shofar does not fulfill the obligation. See Mishnah Beruruah 589:9