Now that I have done many tests, I'll share how I finally did it:
Play a continuous 1 kHz sine signal with a studio monitor loudspeaker
Adjust the playback volume such that the measured volume, close to the microphone, is 94 dB SPL, by using a sound level SPL metersound level SPL meter. Two usefulUseful tips:
the SPL meter should be close to the loudspeaker (then we have consistent measurements if we repeat them), if too far the measurements are inconsistent
the person who does the measurements should not be/move close to the mic/SPL meter/loudspeaker, not because of the noise he produces, but more because of the reflection "wall" he creates in the room (when moving close to the loudspeaker and then moving away, I noticed the recorded 1k sine has not a flat envelope! When standing far from the mic/SPL meter/loudspeaker, it does have a flat envelope, as desired)
[![enter image description here][1]][1]
More generally, the dB SPL measurement is rather dependent of the position/angle between the SPL meter and the loudspeaker, and idem for the microphone: turning the microphone or SPL meter facing the loudspeaker of a few degrees will change the measured level of a few dB (example: it can change from 94 dB to 91 dB), so it is required to not move the microphone/SPL meter/loudspeaker during the recording session.
Sidenote: some people use such expensive calibration tools that produce a 94 dB SPL 1Khz sine, in which you insert the microphone; this probably avoids the loudspeaker and microphone orientation problems.
Record the audio signal with a digital audio interface (if you're using a laptop, unplug the AC adapter and power it from battery, to avoid the typical 50 Hz noise and other power supply noises)
Stop the playback of the sine and also record some silence (and thus some microphone noise: that is precisely what we want to measure!). Tip: power off the loudspeaker to avoid recording the quiet "shhhhh" noise of the loudspeaker
Apply the A-weighting or CCIR-weighting (also called ITU-R 468 weighting), for example with endolith's code here
Now compute :
- the dB RMS of the A-weighted signal, during the silence/noise-only part
- the dB RMS of the A-weighted signal, during the sine part
Subtract both numbers, this will be the final "Signal-to-noise ratio, A-weighted (re. 94 dB SPL) of the microphone".