def _prepare_impl(self, use_file, sample_width, sample_rate, num_channels, frequency): """Prepare for audio recording (interface override). @param use_file: If a file was used to produce audio. This is necessary if audio of a particular frequency is being produced. @param sample_width: The recorded sample width. @param sample_rate: The recorded sample rate. @param num_channels: The number of recorded channels. @param frequency: Frequency of audio being produced. """ req = sequenced_request.SequencedFeedbackRequest( self.test, self.dut, 'Audio recording') # TODO(ralphnathan) Lift the restriction regarding recording time once # the test allows recording for arbitrary periods of time (b/26924426). req.append_question( 'Device %(dut)s will start recording audio for 10 seconds. ' 'Please prepare for producing sound and hit Enter to ' 'continue...', input_handlers.PauseInputHandler()) self._process_request(req) self._sample_width = sample_width self._sample_rate = sample_rate self._num_channels = num_channels if use_file: self._frequency = frequency else: self._frequency = None
def _emit_impl(self): """Emit sound for recording (interface override).""" req = sequenced_request.SequencedFeedbackRequest( self.test, self.dut, None) req.append_question( 'Device %(dut)s is recording audio, hit Enter when done ' 'producing sound...', input_handlers.PauseInputHandler()) self._process_request(req)
def _prepare_impl(self, **kwargs): """Prepare for audio playback (interface override).""" req = sequenced_request.SequencedFeedbackRequest( self.test, self.dut, 'Audible playback') req.append_question( 'Device %(dut)s will play a short audible sample. Please ' 'prepare for listening to this playback and hit Enter to ' 'continue...', input_handlers.PauseInputHandler()) self._process_request(req)
def _prepare_impl(self): """Prepare for silent playback (interface override).""" req = sequenced_request.SequencedFeedbackRequest( self.test, self.dut, 'Silent playback') req.append_question( 'Device %(dut)s will play nothing for a short time. Please ' 'prepare for listening to this silence and hit Enter to ' 'continue...', input_handlers.PauseInputHandler()) self._process_request(req)
def _prepare_impl(self): """Prepare for audio recording (interface override).""" req = sequenced_request.SequencedFeedbackRequest( self.test, self.dut, 'Audio recording') # TODO(ralphnathan) Lift the restriction regarding recording time once # the test allows recording for arbitrary periods of time (b/26924426). req.append_question( 'Device %(dut)s will start recording audio for 10 seconds. ' 'Please prepare for producing sound and hit Enter to ' 'continue...', input_handlers.PauseInputHandler()) self._process_request(req)