def loadSnd(self,e):
wildcard = "All files|*.*|" \
"AIFF file|*.aif;*.aiff;*.aifc;*.AIF;*.AIFF;*.Aif;*.Aiff|" \
"Wave file|*.wav;*.wave;*.WAV;*.WAVE;*.Wav;*.Wave"
dlg = wx.FileDialog(self, message="Choose a new soundfile...",
wildcard=wildcard, style=wx.FD_OPEN)
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
if path != "":
# FL 10/02/2017 START
try:
# self.chooseSnd.SetLabel("Ready")
self.stopSnd(e)
self.audio.changeSnd(path)
self.sndDurSecs = sndinfo(path)[1] # FL 02/09/2107
self.chrono.SetLabel(self.secs2Time(0))
self.timeLeft.SetLabel("- "+ self.secs2Time(self.sndDurSecs))
self.sndName.SetLabel(os.path.split(path)[1])
except:
self.audio.changeSnd(EMPTY_AUDIO_FILE)
self.chrono.SetLabel("--:--:--.--")
self.timeLeft.SetLabel("- --:--:--.--")
self.sndName.SetLabel("<WAV or AIFF soundfiles only>")
if self.audio.noSound:
self.playPause.Disable()
self.stopBtn.Disable()
else:
self.playPause.Enable()
self.stopBtn.Enable()
# FL END
dlg.Destroy()
self.Refresh()
# J'ai tellement pas de mérite j'ai pris cette fonction sur Internet lol
# FL 02/09/2017
评论列表
文章目录