Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import numpy as np
  2. import sounddevice as sd
  3. phase = 90 * 2 * np.pi / 360
  4.  
  5. sine_A = (np.sin(2 * np.pi * np.arange(self.fs * self.duration) * frequency / self.fs + phase)).astype(
  6. np.float32)
  7. sine_B = (np.sin(2 * np.pi * np.arange(self.fs * self.duration) * frequency / self.fs)).astype(np.float32)
  8.  
  9. sumSine= np.array([sine_A, sine_B])
  10. sd.play(sumSine)
  11.  
  12. sounddevice.PortAudioError: Error opening OutputStream: Invalid number of channels
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement