def preload(self): """Preload stimulus to memory.""" if not self._is_preloaded: # Due to a bug in handling file names in PyGame 1.9.2, we pass a file # handle to PyGame. See also: # https://github.com/expyriment/expyriment/issues/81 with open(self._filename, 'rb') as f: self._file = mixer.Sound(f) self._is_preloaded = True
def load(self): self.unload() if self.source is None: return self._data = mixer.Sound(self.source)
def load(self): self.unload() if self.filename is None: return self._data = mixer.Sound(self.filename)
def preload(self): """Preload stimulus to memory.""" if not self._is_preloaded: self._file = mixer.Sound(unicode2str(self._filename, fse=True)) self._is_preloaded = True