def create(self, soundfile, format):
file_path = soundfile.get_format_path(format)
- cmd = ['sox', soundfile.file.path, file_path]
+ cmd = ['ffmpeg', '-y', '-i', soundfile.file.path]
if format == 'ogg':
- cmd[-1:-1] = ['-C', '4'] # q4 (~128kbps)
+ cmd.extend(['-q:a', '5'])
elif format == 'mp3':
- cmd[-1:-1] = ['-C', '-4'] # vbr @ ~128kbps
+ cmd.extend(['-q:a', '4'])
+
+ cmd.append(file_path)
if self.verbose:
print 'creating', file_path
- cmd[1:1] = ['--show-progress']
print ' ', ' '.join(cmd)
+ else:
+ cmd[1:1] = ['-loglevel', 'quiet']
subprocess.call(cmd)