aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py')
-rw-r--r--python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py b/python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py
new file mode 100644
index 0000000000..281d0df587
--- /dev/null
+++ b/python/pyarmnn/examples/speech_recognition/tests/test_audio_file.py
@@ -0,0 +1,17 @@
+# Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+
+import os
+
+import numpy as np
+
+from context import audio_capture
+
+
+def test_audio_file(test_data_folder):
+ audio_file = os.path.join(test_data_folder, "myVoiceIsMyPassportVerifyMe04.wav")
+ capture = audio_capture.AudioCapture(audio_capture.ModelParams(""))
+ buffer = capture.from_audio_file(audio_file)
+ audio_data = next(buffer)
+ assert audio_data.shape == (47712,)
+ assert audio_data.dtype == np.float32