Agree with all those who have raised the issue of problems with aliasing. Just to flush things out, it's worth mentioning what effect aliasing has on the quality of the audio output. Nobody seems to have address that issue yet.<p>Aliasing causes higher harmonics to reflect at the Nyquist sampling rate and be heard as a signal with lower frequency. e.g. a 25khz signal with a sampling rate of 24khz will end up sounding like a 23khz signal instead. A 26khz signal will sound like a 22khz signal. And so forth. Because there are exponentially more harmonics as frequency increases, aliased harmonics can end up reflecting a startling amount of energy into audio frequency ranges, even if the amplitude of each harmonic is much lower than the amplitude of the fundamental harmonic.<p>Because the harmonics are reflected, they no longer form a harmonic series, so they end up adding a metallic sound to the overall output signal. The sound of inharmonic aliased signals alone is not unlike the sound of striking a metal dinner plate with a spoon, or a copper pipe with a wrench. Not a pleasant sound.<p>We have very inexact vocabularies for describing sound. But clipped signals with heavy aliasing are usually described in terms like the following: "harsh", "metallic", "cold", "fizzy".<p>In fairness, this is a toy example. One would hope that in a mature ecosystem, those few who are capable of doing the very significant heavy math lifting required to implement better clipping will contribute components that can be shared and reused by everyone.