1# Copyright 2021 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from autotest_lib.server import utils 6 7AUTHOR = "chromeos-chameleon" 8NAME = "audio_AudioNoiseCancellation.noisy_env" 9PURPOSE = "Remotely controlled input noise cancellation audio test." 10CRITERIA = "This test will fail if the captured audio does not reduce noise from the input." 11TIME = "SHORT" 12TEST_CATEGORY = "Functional" 13TEST_CLASS = "audio" 14TEST_TYPE = "server" 15ATTRIBUTES = "suite:audio_advanced" 16DEPENDENCIES = "board:volteer, audio_box" 17JOB_RETRIES = 1 18PY_VERSION = 3 19 20DOC = """ 21This test checks if the speech quality is improved by NC when the input is mixed with noises. 22During the test, the speech and noise files will be mixed and played by Chameleon, while DUT 23records via the internal mic with NC enabled and disabled respectively. The score difference 24calculated by ViSQOL with the speech file as reference should not be less than the threshold 25specified in test_data. 26""" 27 28args_dict = utils.args_to_dict(args) 29chameleon_args = hosts.CrosHost.get_chameleon_arguments(args_dict) 30 31# Test files are located in gs://chromeos-localmirror/distfiles/test_noise_cancellation 32# Both files are 15-second, 1-channel, 16k-rate. 33test_data = dict(speech_file='speech_ref.wav', 34 noise_file='office_noise.wav', 35 threshold=0.1) 36 37def run(machine): 38 host = hosts.create_host(machine, chameleon_args=chameleon_args) 39 job.run_test("audio_AudioNoiseCancellation", host=host, test_data=test_data, tag='noisy_env') 40 41parallel_simple(run, machines) 42