Large-eddy simulation of a turbulent shear layer interacting with a thin airfoil is performed to investigate the sound generation. The turbulent shear layer is generated using a separate temporal simulation and fed into airfoil simulations as an inflow boundary condition to closely match the setup of a previous experiment. Three different airfoil locations are considered, one at the center of the shear layer and two in the outer regions of the layer on both the high- and low-speed sides.Simulation results show that the impact of the airfoil on the shear layer flow statistics is largest at the center position and nearly negligible at the two outer positions. The airfoil unsteady lift shows strong influence of the shear-layer roller structures at all positions in addition to localized small-scale fluctuations. The far-field sound is calculated using a boundary-element solution to the Lighthill equation. Contributions from sources in the airfoil leading and trailing edge regions are evaluated and compared. Results show good agreement with experimental spectra of leading edge noise over a wide frequency range. The high and middle airfoils produce comparable sound pressure levels, while the low airfoil produces the weakest sound. Leading-edge interaction with the shear layer is shown to be the dominant noise source at most frequencies, and self noise due to trailing-edge vortex shedding is significant only for middle and high airfoil positions at high frequenciesPressure fluctuations on the airfoil surface are also examined to elucidate the scattered-noise production. At all airfoil positions, the spectral levels of the spanwise-averaged surface pressure are largest at low frequencies near the leading edge. Near the trailing edge of both the center and high airfoils an increase in high-frequency spectral levels is observed, confirming important trailing-edge contribution to the high-frequency radiated sound.