def get_sampling_rate_labels(self): rates = [] for rate in AvcConnection.SAMPLING_RATES: if not AvcConnection.ask_plug_signal_format( self.unit.fcp, 'input', 0, rate): continue if not AvcConnection.ask_plug_signal_format( self.unit.fcp, 'output', 0, rate): continue rates.append(rate) return rates
def _parse_supported_sampling_rates(self): sampling_rates = {} playback = [] capture = [] # Assume that PCM playback is available for all of models. for rate in AvcConnection.SAMPLING_RATES: if AvcConnection.ask_plug_signal_format(self.fcp, 'input', 0, rate): playback.append(rate) sleep(0.02) # PCM capture is not always available depending on models. for rate in AvcConnection.SAMPLING_RATES: if AvcConnection.ask_plug_signal_format(self.fcp, 'output', 0, rate): capture.append(rate) self._playback_only = (len(capture) == 0) for rate in AvcConnection.SAMPLING_RATES: if rate in playback or rate in capture: sampling_rates[rate] = True return sampling_rates