Click on the flag to start. Blue dots are air molecules - Changes in air presurre (denisty of air molecules) causes the sound wave to propogate through the air. Yellow dots - the samples taken by the computer. A microphone captures the variations in air pressure and transliates these into a voltage. Each time a sample is taken the amount of voltage (amplitude) is converted into a binary number that can be used or stored by the computer. (Scratch has no way of capturing frequency information so, when the microphone is used, the animation shows changes in amplitude. This is illustrative but not accurate).
Based on NCCE for the original project Sound waves. A sample rate slider has been added that controls the number of samples displayed.