# HG changeset patch # User Drew Perttula # Date 1182121063 0 # Node ID 26a73a4647cbfa1e2225b77df9c2974123132a8b # Parent e748d6edd37574a3a7896f7f0e7e281c2a7b0bc7 ascoltami cache filling diff -r e748d6edd375 -r 26a73a4647cb bin/ascoltami --- a/bin/ascoltami Sun Jun 17 22:42:25 2007 +0000 +++ b/bin/ascoltami Sun Jun 17 22:57:43 2007 +0000 @@ -196,12 +196,22 @@ self.mpd.add(showconfig.songInMpd(MUS['preSong'])) self.mpd.add(showconfig.songInMpd(song)) self.mpd.add(showconfig.songInMpd(MUS['postSong'])) + + self.fillCache(song) + self.filename_var.set(graph.value(song, L9['showPath'])) self.song_uri = song self.set_total_time(song) self.seek_to(-4) + def fillCache(self, song): + """read the song's entire wav file into memory just before + playing, so that mpd should never hit the disk during + playback. On score in 2007, we had some mpd stutters that were + always timed with a disk read.""" + open(showconfig.songOnDisk(song)).read() + def check_autopause(self): pause_time = self.total_time.get() + self.song_pad_time t = self.current_time.get()