MCPcopy Create free account
hub / github.com/dofuuz/python-soxr / make_tone

Function make_tone

tests/vr.py:6–12  ·  view source on GitHub ↗
(freq, sr, duration)

Source from the content-addressed store, hash-verified

4
5
6def 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'''
15rs = soxr.ResampleStream(1, 20, 1, vr=True)

Callers 1

vr.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected