ctypes Beep

Just a small "audible" test of ctypes. Obviously only working on windows ( kernel32.dll).

import math

from ctypes import cdll

k = cdll.LoadLibrary( 'kernel32.dll' )

i = 0.0

while True:

i += 0.05

try: k.Beep( int(math.sin( i ) * 500 + 1000) , 10 )

except ValueError, e: pass