Rosh Hashanah 3:7
Rosh Hashanah3: 7
הַתּוֹקֵעַ לְתוֹךְ הַבּוֹר אוֹ לְתוֹךְ הַדּוּת אוֹ לְתוֹךְ הַפִּטָּם: אִם קוֹל שׁוֹפָר שָׁמַע, יָצָא; וְאִם קוֹל הֲבָרָה שָׁמַע, לֹא יָצָא. וְכֵן מִי שֶׁהָיָה עוֹבֵר אֲחוֹרֵי בֵית הַכְּנֶסֶת, אוֹ שֶׁהָיָה בֵיתוֹ סָמוּךְ לְבֵית הַכְּנֶסֶת, וְשָׁמַע קוֹל שׁוֹפָר אוֹ קוֹל מְגִלָּה: אִם כִּוֵּן לִבּוֹ, יָצָא; וְאִם לָאו, לֹא יָצָא — אַף עַל פִּי שֶׁזֶּה שָׁמַע וְזֶה שָׁמַע, זֶה כִּוֵּן לִבּוֹ וְזֶה לֹא כִוֵּן לִבּוֹ.
If a person blows [a shofar] into a pit or into a cistern or into a cask: if one heard the sound of the shofar, he has fulfilled his obligation; but if he heard the sound of an echo, he has not fulfilled his obligation.  Similarly, if one were passing behind a synagogue, or if his house was close to a synagogue, and he heard the sound of the shofar or the sound [of the reading] of the Megillah: if he concentrated, he has fulfilled his obligation; but if not, he has not fulfilled his obligation —- even though both he and someone else listened, this one concentrated but the other did not concentrate.