• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1from acts import asserts
2from acts.signals import TestPass
3from acts.test_utils.audio_analysis_lib import audio_analysis
4from acts.test_utils.bt.A2dpCodecBaseTest import A2dpCodecBaseTest
5
6
7class SineWaveQualityTest(A2dpCodecBaseTest):
8
9    def setup_class(self):
10        super().setup_class()
11        channel_results = audio_analysis.get_file_anomaly_durations(
12            filename=self.host_music_file,
13            **self.audio_params.get('anomaly_params', {}))
14        # If file specified in test config is not a sine wave tone, this fails.
15        for channel, anomalies in enumerate(channel_results):
16            asserts.assert_equal(anomalies, [], 'Test file not pure',
17                extras=self.metrics)
18        self.log.info('Test file inspected.')
19
20    def test_streaming(self):
21        self.play_and_record_audio()
22        self.run_thdn_analysis()
23        self.run_anomaly_detection()
24        raise TestPass('Completed music streaming.', extras=self.metrics)
25