Beispiel #1
0
 def play(self):
     if not self._data:
         return
     self._data.set_volume(self.volume)
     self._channel = self._data.play()
     self.start_time = Clock.time()
     # schedule event to check if the sound is still playing or not
     self._check_play_ev = Clock.schedule_interval(self._check_play, 0.1)
     super(SoundPygame, self).play()
Beispiel #2
0
 def play(self):
     if not self._data:
         return
     self._data.set_volume(self.volume)
     self._channel = self._data.play()
     self.start_time = Clock.time()
     # schedule event to check if the sound is still playing or not
     self._check_play_ev = Clock.schedule_interval(self._check_play, 0.1)
     super(SoundPygame, self).play()
Beispiel #3
0
 def get_pos(self):
     if self._data is not None and self._channel:
         if _platform == 'android':
             return self._channel.get_pos()
         return Clock.time() - self.start_time
     return 0
Beispiel #4
0
 def get_pos(self):
     if self._data is not None and self._channel:
         if _platform == 'android':
             return self._channel.get_pos()
         return Clock.time() - self.start_time
     return 0