SHARE
TWEET

Untitled

a guest Sep 17th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top