Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import math
  2. import numpy as np
  3. import scipy.io.wavfile as swf
  4.  
  5. r = np.linspace(0, 1, 1024, endpoint=False)
  6. q = np.sin(r * 2 * math.pi) * 16384
  7. q = q.astype('int16')
  8. c = np.concatenate([q, q, q, q, q, q, q, q, q, q, q, q, q, q, q, q, q,
  9. q, q, q, q, q, q, q, q, q, q, q, q, q, q, q, q, q, q])
  10. swf.write("/Users/paul/Desktop/sine1024.wav", 44100, c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement