Based on discussion in crbug/679552:
Jimmy, while discussing this issue, we also were discussing whether we should add a pure 'silence' test. I thought there could be two variations to it:
1. Validate silence when there is no playback activity.
2. Validate silence when a silent audio file is playing.
Do you think such a silence test would be useful? Do the two variations make sense?
----
Re#4
- Using separate test is good too. We can keep basic test simple.
- Measurement tool, that is, quality_measurement function in client/cros/audio/audio_quality_measurement.py returns noise at different places.
@returns: A dictoinary of detection/estimation:
{'artifacts':
{'noise_before_playback':
[(time_1, duration_1), (time_2, duration_2), ...],
'noise_after_playback':
[(time_1, duration_1), (time_2, duration_2), ...],
'delay_during_playback':
[(time_1, duration_1), (time_2, duration_2), ...],
'burst_during_playback':
[time_1, time_2, ...]
},
'volume_changes':
[(time_1, flag_1), (time_2, flag_2), ...],
'equivalent_noise_level': level
}
so it is easy to see where is the noise.
This is also why I suggest in #2, where we let chameleon record full silence -> play -> silence duration.
- The basic check only check if dominant frequency is correct. Silence does not contribute to any value on the spectrum, so that half silence does not affect dominant frequency.
- About silence test, we should also exercise mute function. For example, while in mute state, play an audio file, and check if it is silence.
Currently we don't have a function to check whether recorded audio is silence. I think we can use a threshold and a for loop to check every sample value is below that threshold. We should have a separate issue tracking adding mute test, for catching issue like https://bugs.chromium.org/p/chromium/issues/detail?id=681890.
Comment 1 by vsu...@chromium.org
, Mar 15 2017