@@ -0,0 +1,688 @@
+# Make a wave file (.wav) consisting of a sine wave%0A# Adapted from http://www.swharden.com%0A%0Afrom struct import pack%0Afrom math import sin, pi%0Aimport wave%0A%0AFs = 8000 # Frequency %0A%0A## CREATE MONO FILE ##%0A%0Awf = wave.open('sin02_mono.wav', 'w')%09%09# wf : wave file%0Awf.setnchannels(1)%09%09%09%09%09%09%09# one channel (mono)%0Awf.setsampwidth(4)%09%09%09%09%09%09%09# two bytes per sample%0Awf.setframerate(Fs)%09%09%09%09%09%09%09# samples per second%0AmaxAmp = 2**31 - 1.0 %09%09%09%09%09%09# maximum amplitude%0Af = 261.625565  %09%09%09%09%09%09%09# Hz (middle C)%0Afor n in range(0, 2*Fs):  %09%09%09%09%09# 2 seconds duration%0A%09wvData = pack('i', maxAmp * sin(n*2*pi*f/Fs)) %0A    # i indicate 'integer'  ('%3Ci' or '%3Ei' for different Endians)%0A%09wf.writeframesraw(wvData)%0Awf.close()%0A

Create creating_mono.py