()
| 21 | |
| 22 | |
| 23 | def test_issue_22(): |
| 24 | np.random.seed(0) |
| 25 | |
| 26 | n_mics = 1 |
| 27 | n_src = 1 |
| 28 | n_times = 25000 |
| 29 | dim = 3 |
| 30 | mic_pos = np.random.rand(dim, n_mics) |
| 31 | abs_coeff = 0.1 |
| 32 | e_abs = 1.0 - (1.0 - abs_coeff) ** 2 |
| 33 | fs = 16000 |
| 34 | wall_max_len = 15 |
| 35 | |
| 36 | room_dim = np.random.rand(dim) * wall_max_len |
| 37 | |
| 38 | shoebox = pyroomacoustics.ShoeBox( |
| 39 | room_dim, |
| 40 | materials=pyroomacoustics.Material(e_abs), |
| 41 | fs=fs, |
| 42 | max_order=0, |
| 43 | ) |
| 44 | |
| 45 | src_pos = np.random.rand(dim, n_src) * room_dim[:, None] |
| 46 | for src in src_pos.T: |
| 47 | shoebox.add_source(src) |
| 48 | |
| 49 | shoebox.add_microphone_array(pyroomacoustics.MicrophoneArray(mic_pos, fs)) |
| 50 | |
| 51 | for i in range(n_times): |
| 52 | shoebox.image_source_model() |
| 53 | |
| 54 | if i != 0 and i % 1000 == 0: |
| 55 | print(i) |
| 56 | |
| 57 | |
| 58 | if __name__ == "__main__": |
no test coverage detected