2
2
import numpy as np
3
3
4
4
def test_mono_double_length ():
5
- x1 = np .random .rand ( 1 , 44100 )
6
- x2 = np .random .rand ( 1 , 22050 )
5
+ x1 = np .random .normal ( 0 , 0.1 , size = ( 1 , 44100 )). astype ( np . float32 )
6
+ x2 = np .random .normal ( 0 , 0.1 , size = ( 1 , 22050 )). astype ( np . float32 )
7
7
8
8
ps = m .Signalsmith .Stretch ()
9
9
ps .setTimeFactor (0.5 )
@@ -16,8 +16,8 @@ def test_mono_double_length():
16
16
assert y2 .shape == (1 , 44100 )
17
17
18
18
def test_mono_half_length ():
19
- x1 = np .random .rand ( 1 , 44100 )
20
- x2 = np .random .rand ( 1 , 22050 )
19
+ x1 = np .random .normal ( 0 , 0.1 , size = ( 1 , 44100 )). astype ( np . float32 )
20
+ x2 = np .random .normal ( 0 , 0.1 , size = ( 1 , 22050 )). astype ( np . float32 )
21
21
22
22
ps = m .Signalsmith .Stretch ()
23
23
ps .setTimeFactor (2. )
@@ -30,8 +30,8 @@ def test_mono_half_length():
30
30
assert y2 .shape == (1 , 11025 )
31
31
32
32
def test_stereo_double_length ():
33
- x1 = np .random .rand ( 2 , 44100 )
34
- x2 = np .random .rand ( 2 , 22050 )
33
+ x1 = np .random .normal ( 0 , 0.1 , size = ( 2 , 44100 )). astype ( np . float32 )
34
+ x2 = np .random .normal ( 0 , 0.1 , size = ( 2 , 22050 )). astype ( np . float32 )
35
35
36
36
ps = m .Signalsmith .Stretch ()
37
37
ps .setTimeFactor (0.5 )
@@ -59,8 +59,8 @@ def test_stereo_half_length():
59
59
60
60
def test_multichannel_double_length ():
61
61
n_channels = np .random .randint (3 , 10 )
62
- x1 = np .random .rand ( n_channels , 44100 )
63
- x2 = np .random .rand ( n_channels , 22050 )
62
+ x1 = np .random .normal ( 0 , 0.1 , size = ( n_channels , 44100 )). astype ( np . float32 )
63
+ x2 = np .random .normal ( 0 , 0.1 , size = ( n_channels , 22050 )). astype ( np . float32 )
64
64
65
65
ps = m .Signalsmith .Stretch ()
66
66
ps .setTimeFactor (0.5 )
@@ -74,8 +74,8 @@ def test_multichannel_double_length():
74
74
75
75
def test_multichannel_half_length ():
76
76
n_channels = np .random .randint (3 , 10 )
77
- x1 = np .random .rand ( n_channels , 44100 )
78
- x2 = np .random .rand ( n_channels , 22050 )
77
+ x1 = np .random .normal ( 0 , 0.1 , size = ( n_channels , 44100 )). astype ( np . float32 )
78
+ x2 = np .random .normal ( 0 , 0.1 , size = ( n_channels , 22050 )). astype ( np . float32 )
79
79
80
80
ps = m .Signalsmith .Stretch ()
81
81
ps .setTimeFactor (2. )
0 commit comments