-
Notifications
You must be signed in to change notification settings - Fork 1
/
experiment.py
56 lines (50 loc) · 1.33 KB
/
experiment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from AcousticSimulation import RoomParam, SourceInfo
from BSS import GC_AUX_IVA_PARAMS
from VC import VC_PARAM
from spatial_voice_conversion import spatical_vc, ideal_spatical_vc
def execute(
output_top_dir: str,
source_info: SourceInfo,
noise_info: SourceInfo,
room_param: RoomParam,
bss_param: GC_AUX_IVA_PARAMS,
vc_param: VC_PARAM
):
# spatial vc
spatical_vc(
output_top_dir,
[source_info, noise_info],
room_param,
bss_param,
vc_param
)
# ideal
ideal_spatical_vc(
output_top_dir,
[source_info, noise_info],
room_param,
bss_param,
vc_param
)
def test():
from BSS import get_steering_vector
from config import fs, stft_window_size
output_top_dir = "output/test"
source_info = SourceInfo("test_data/jvs001.wav", -60)
noise_info = SourceInfo("test_data/jvs002.wav", 60)
room_param = RoomParam(fs)
steering_vector = get_steering_vector(
source_info.deg, fs, stft_window_size, room_param.mic_distance
)
bss_param = GC_AUX_IVA_PARAMS(steering_vector)
vc_param = VC_PARAM(3, 0)
execute(
output_top_dir,
source_info,
noise_info,
room_param,
bss_param,
vc_param
)
if __name__ == '__main__':
test()