audio_basic¶
Source code: audio_basic.py
Test basic audio record and playback.
Description¶
This test check both record and playback for headset and built-in audio by recording audio, play it back and ask operator for confirmation. An additional pre-recorded sample is played to confirm speakers operate independently. Each channel of input and output would be tested.
Test Procedure¶
Instruction is shown on screen to ask operator to press either ‘P’ or ‘R’.
After operator press ‘P’, a pre-recorded sample is played back.
After operator press ‘R’, 3 seconds of audio would be recorded and played back.
Operator press space key to confirm both 2. and 3. step completes without problem, and the audio played back sounds correct.
Dependency¶
External program sox.
Device API
cros.factory.device.audio
.
Examples¶
To check that audio can be recorded and played, add this into test list:
{
"pytest_name": "audio_basic",
"label": "Speaker/Microphone Manual Test",
"related_components": [
"test_tags.TestCategory.AUDIOCODEC",
"test_tags.TestCategory.SMART_SPEAKER_AMPLIFIER",
"test_tags.TestCategory.SPEAKERAMPLIFIER"
],
"args": {
"input_dev": [
"eval! device.component.audio_card_name or constants.audio.card_name",
"99"
],
"output_dev": [
"eval! device.component.audio_card_name or constants.audio.card_name",
"0"
]
}
}
See audio_loop.py for more details about how to set
output_dev
.
Test Arguments¶
Name |
Type |
Description |
---|---|---|
audio_title |
str, dict |
(optional; default: |
audio_conf |
str, None |
(optional; default: |
initial_actions |
list, None |
(optional; default: |
input_dev |
list |
(optional; default: |
output_dev |
list |
(optional; default: |
output_channels |
int |
(optional; default: |
input_channels |
int |
(optional; default: |
require_headphone |
bool |
(optional; default: |
timeout_secs |
int |
(optional; default: |