1# Copyright (c) 2012 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
5AUTHOR = "Chromium OS Project"
6NAME = "desktopui_MediaAudioFeedback"
7PURPOSE = "Verify sound from media files is audible"
8CRITERIA = """
9This test will fail if media files sound is not audible.
10"""
11ATTRIBUTES = "suite:bvt-perbuild"
12SUITE = "bvt-perbuild"
13TIME = "SHORT"
14TEST_CATEGORY = "General"
15TEST_CLASS = "desktopui"
16TEST_TYPE = "client"
17DEPENDENCIES = 'audio_loopback_dongle'
18
19DOC = """
20Test that the sound from media files can be heard by recording from mic in.
21Each audio channel is tested independently and currently there is no accurate
22comparison with the input data. Instead the test passes when
23a) the silent signal is sufficiently weak and (TODO: rohitbm@chromium.org)
24b) the captured audio from each media replay is sufficiently loud.
25
26NOTE: For this test to pass you need to have the line out looped back to mic-in.
27This can be through a 3.5mm male-to-male cable or a loopback dongle depending on
28your device.
29"""
30
31# Media formats to be tested. The length of these audio are all 5 seconds.
32TEST_DURATION = 5
33TEST_FILES = ['sine440.mp3',
34              'sine440.mp4',
35              'sine440.wav',
36              'sine440.ogv',
37              'sine440.webm']
38
39constraints = ['%s_rms_value > 0.05' % s.replace('.', '_') for s in TEST_FILES]
40
41job.run_test('desktopui_MediaAudioFeedback',
42             test_files=TEST_FILES,
43             test_duration=TEST_DURATION,
44             constraints=constraints)
45