def stopReplay(self): if self.replayActive: AudioPlayer.ogg_closeFile() AudioPlayer.audio_stop() self.replayActive=False self.active_checkBox.setEnabled(True)
def switchToOgg(self, newOgg, onlyIfPlaysUntilTime): if (self.currentFile!=newOgg): if (self.currentFile!=None): AudioPlayer.ogg_closeFile() if (newOgg!=None): AudioPlayer.ogg_openFile(str(self.dataDirectory+newOgg[0])) AudioPlayer.ogg_startDecoding() self.currentFile=newOgg return newOgg!=None return False
def loadRecording(self, dataDirectory): self.active_checkBox.setChecked(False) #create list of available ogg files in current recording self.dataDirectory=dataDirectory+self.name+"/" self.setEnabled(os.path.isdir(self.dataDirectory)) if not os.path.isdir(self.dataDirectory): self.oggFiles=[] return self.oggFiles=[[f,parseAudioFileNameTime(f)] for f in os.listdir(self.dataDirectory) if (f[f.rfind('.'):].lower()==".ogg")] self.setEnabled(self.oggFiles!=[]) if self.oggFiles==[]: return for oggFile in self.oggFiles: AudioPlayer.ogg_openFile(str(self.dataDirectory+oggFile[0])) oggFile.append(AudioPlayer.ogg_getLength()) AudioPlayer.ogg_closeFile() self.active_checkBox.setChecked(True) self.currentFile=None self.replayActive=False