(freq, sr, duration)
| 4 | |
| 5 | |
| 6 | def make_tone(freq, sr, duration): |
| 7 | # make reference tone |
| 8 | length = int(sr * duration) |
| 9 | sig = np.sin(2 * np.pi * freq / sr * np.arange(length)) |
| 10 | sig = sig * np.hanning(length) |
| 11 | |
| 12 | return np.stack([sig, np.zeros_like(sig)], axis=-1) |
| 13 | |
| 14 | ''' |
| 15 | rs = soxr.ResampleStream(1, 20, 1, vr=True) |