Ejemplo n.º 1
0
 def _bluetooth_play(self):
   """ This method will start playing via the bluetooth connection.
   """
   self.logger.info("Connecting Bluetooth")
   self.tal_http.set_active_source(comm_const.SourceJidPrefix.BLUETOOTH)
   self._bluetooth.connect(self.tal.bluetooth_mac_address)
   Helpers.unmute_sound_output(self.sound_card)
   self.logger.info("Start playing Bluetooth")
   self.tal_http.set_active_source(comm_const.SourceJidPrefix.BLUETOOTH)
   self._bluetooth.play_frequency(self._BLUETOOTH_FREQUENCY, self._BLUETOOTH_PLAY_DURATION, 10)
   self._verification.verify_active_source(comm_const.Source.BLUETOOTH)
Ejemplo n.º 2
0
 def _bluetooth_play(self):
     """ This method will start playing via the bluetooth connection.
 """
     self.logger.info("Connecting Bluetooth")
     self.tal_http.set_active_source(comm_const.SourceJidPrefix.BLUETOOTH)
     self._bluetooth.connect(self.tal.bluetooth_mac_address)
     Helpers.unmute_sound_output(self.sound_card)
     self.logger.info("Start playing Bluetooth")
     self.tal_http.set_active_source(comm_const.SourceJidPrefix.BLUETOOTH)
     self._bluetooth.play_frequency(self._BLUETOOTH_FREQUENCY,
                                    self._BLUETOOTH_PLAY_DURATION, 10)
     self._verification.verify_active_source(comm_const.Source.BLUETOOTH)
Ejemplo n.º 3
0
  def _linein_play(self):
    """
    Method will first change the source of ASE to line-in then start playing.
    """
    # checking if 3 min from the last line-in play have passed
    linein_pause_time = self._LINE_IN_PAUSE_TIME - (time.time() - self._linein_stop_time)
    if linein_pause_time > 0:
      self.logger.info("Sleeping %s sec to enable line-in" % linein_pause_time)
      time.sleep(linein_pause_time)

    self.logger.info("Start playing line-in")
    Helpers.unmute_sound_output(self.sound_card)

    self._linein.play_frequency(self._FREQUENCY, self._LINE_IN_PLAY_DURATION)
    self._verification.verify_active_source(comm_const.Source.LINEIN)
Ejemplo n.º 4
0
    def _linein_play(self):
        """
    Method will first change the source of ASE to line-in then start playing.
    """
        # checking if 3 min from the last line-in play have passed
        linein_pause_time = self._LINE_IN_PAUSE_TIME - (time.time() -
                                                        self._linein_stop_time)
        if linein_pause_time > 0:
            self.logger.info("Sleeping %s sec to enable line-in" %
                             linein_pause_time)
            time.sleep(linein_pause_time)

        self.logger.info("Start playing line-in")
        Helpers.unmute_sound_output(self.sound_card)

        self._linein.play_frequency(self._FREQUENCY,
                                    self._LINE_IN_PLAY_DURATION)
        self._verification.verify_active_source(comm_const.Source.LINEIN)