The radiation of sound from artificial sources in a developing shear layer is studied numerically, in order to address an issue that arises in acoustic analogy models of jet noise: namely whether the unstable response of the mean-flow shear layer has a significant effect on sound radiation. Direct numerical simulation of a forced two-dimensional compressible laminar mixing layer has been carried out at a Reynolds number of 250, based on the mixing layer initial vorticity thickness and the upper free-stream velocity. The free-stream Mach numbers of the mixing layer are 0.9 and 0.45. The flow is excited with a single-frequency body force field that is acoustically compact and is derived from an applied-stress distribution. Sound radiation from the mixing layer is calculated at the forcing frequency, and compared with radiation from a uniform flow under the same forcing. Comparisons are shown for the most-unstable forcing frequency over a wide amplitude range. The pressure radiated on either side of the mixing layer differs very little from that radiated into a uniform flow of the same Mach number under the same forcing, although the higher forcing amplitudes used are sufficient to trigger the non-linear process of vortex roll-up in the case of the mixing layer. The dominant source position for the radiated pressure at the forcing frequency is estimated via a wavenumber-frequency domain analysis. It is found to be close to the location of the applied forcing, with little contribution from mixing-layer vortical structures that develop downstream.