Éanna Ó Catháin | 145c88f | 2020-11-16 14:12:11 +0000 | [diff] [blame] | 1 | # Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | |
| 4 | import os |
| 5 | |
| 6 | import numpy as np |
| 7 | |
| 8 | from context import audio_capture |
| 9 | |
| 10 | |
| 11 | def test_audio_file(test_data_folder): |
| 12 | audio_file = os.path.join(test_data_folder, "myVoiceIsMyPassportVerifyMe04.wav") |
| 13 | capture = audio_capture.AudioCapture(audio_capture.ModelParams("")) |
| 14 | buffer = capture.from_audio_file(audio_file) |
| 15 | audio_data = next(buffer) |
| 16 | assert audio_data.shape == (47712,) |
| 17 | assert audio_data.dtype == np.float32 |