def qcpfinal(self, start, duration, volume=None): conversions.converttowav(self.file, self.wavfile, samplerate=8000, channels=1, start=start, duration=duration) if volume is not None: conversions.adjustwavfilevolume(self.wavfile, volume) conversions.convertwavtoqcp(self.wavfile, self.qcpfile, self.optimization.GetSelection()) return open(self.qcpfile, "rb").read()
def _trim_and_adjust_vol_mp3(self, start, duration, volume): conversions.converttowav(self.file, self.wavfile, start=start, duration=duration) conversions.adjustwavfilevolume(self.wavfile, volume) return conversions.converttomp3(self.wavfile, int(self.bitrate.GetStringSelection()), int(self.samplerate.GetStringSelection()), int(self.channels.GetStringSelection()))
def qcpfinal(self, start, duration, volume=None): # use the original to make a new wav, not the one that went through foo -> qcp -> wav conversions.converttowav(self.file, self.wavfile, samplerate=8000, channels=1, start=start, duration=duration) if volume is not None: conversions.adjustwavfilevolume(self.wavfile, volume) conversions.convertwavtoqcp(self.wavfile, self.qcpfile, self.optimization.GetSelection()) return file(self.qcpfile, "rb").read()
def _trim_and_adjust_vol_mp3(self, start, duration, volume): # trim, adjust volume, and write mp3 out # use the original to make a new wav, not the one that went through foo -> mp3 -> wav conversions.converttowav(self.file, self.wavfile, start=start, duration=duration) # adjust the volume conversions.adjustwavfilevolume(self.wavfile, volume) # convert to mp3 return conversions.converttomp3(self.wavfile, int(self.bitrate.GetStringSelection()), int(self.samplerate.GetStringSelection()), int(self.channels.GetStringSelection()))