コード例 #1
0
 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()
コード例 #2
0
 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()))
コード例 #3
0
ファイル: ringers.py プロジェクト: deosai/bitpim
 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()
コード例 #4
0
ファイル: ringers.py プロジェクト: SJLC/portage-overlay
 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()
コード例 #5
0
ファイル: ringers.py プロジェクト: deosai/bitpim
 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()))
コード例 #6
0
ファイル: ringers.py プロジェクト: SJLC/portage-overlay
 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()))