我正在尝试使用这两个相移音调播放立体声信号,但我无法做到
import numpy as np
import sounddevice as sd
fs = 44100
duration = 1
frequency = 440
phase = 90 * 2 * np.pi / 360
sine_A = (np.sin(2 * np.pi * np.arange(fs * duration) * frequency / fs + phase)).astype(
np.float32)
sine_B = (np.sin(2 * np.pi * np.arange(fs * duration) * frequency / fs)).astype(np.float32)
sumSine= np.array([sine_A, sine_B])
sd.play(sumSine)
它返回给我以下错误:
sounddevice.PortAudioError: Error opening OutputStream: Invalid number of channels
我无法追踪问题所在