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.quiet_env" 9PURPOSE = "Remotely controlled input noise cancellation audio test." 10CRITERIA = "This test will fail if the captured audio quality is degraded by NC in a quiet place." 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 not degraded by NC when the input is clean. During 22the test, the speech file will be played by Chameleon, while DUT records via the internal mic 23with NC enabled and disabled respectively. The score difference calculated by ViSQOL with the 24speech file as reference should not be less than the threshold specified in test_data. 25""" 26 27args_dict = utils.args_to_dict(args) 28chameleon_args = hosts.CrosHost.get_chameleon_arguments(args_dict) 29 30# Test files are located in gs://chromeos-localmirror/distfiles/test_noise_cancellation 31# The speech file is 15-second, 1-channel, 16k-rate. 32# The threshold is negative because we can tolerate the slight degradation as the side effect 33# of NC. 34test_data = dict(speech_file='speech_ref.wav', 35 threshold=-0.05) 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='quiet_env') 40 41parallel_simple(run, machines) 42