Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wave
- n=wave.open("n.wav","w") # Open a wav file for writing
- n.setparams((2,2,4e4,0,"NONE","")) # Sets the minimal params for the wav file
- k=68182 # This number is such that the track is ~30 secs
- w=n.writeframes
- h=23450475295733 # Contains base-4 morse code: '.'=1, '-'=3, ' '=0
- while h:
- for i in range(h%2*k):w(h%4*chr(i%99)) # Writes saw-tooth signal using i%99
- w((2-h%2)*k*" ") # Writes the pauses
- h/=4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement