From: yomguy <> Date: Tue, 9 Dec 2008 09:00:59 +0000 (+0000) Subject: (re)Add sox decode before encoding X-Git-Tag: 1.1~782 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4af7ce665efe457244befd86159486247e12e0d5;p=telemeta.git (re)Add sox decode before encoding --- diff --git a/telemeta/export/core.py b/telemeta/export/core.py index 1649c07d..4474529d 100644 --- a/telemeta/export/core.py +++ b/telemeta/export/core.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2007 Parisson SARL +# Copyright (C) 2008 Parisson SARL # Copyright (c) 2006-2007 Guillaume Pellerin # All rights reserved. # @@ -24,7 +24,7 @@ import xml.dom.ext class ExporterCore(Component): """Defines the main parts of the exporting tools : - paths, formats, metadata...""" + paths, metadata parsing, data streaming thru system command""" def __init__(self): self.source = '' diff --git a/telemeta/export/flac.py b/telemeta/export/flac.py index 549c75a7..efac4fd9 100644 --- a/telemeta/export/flac.py +++ b/telemeta/export/flac.py @@ -93,11 +93,11 @@ class FlacExporter(ExporterCore): if not ('verbose' in self.options and self.options['verbose'] != '0'): args.append('-s') if 'flac_quality' in self.options: - args.append('-f -' + self.options['flac_quality']) + args.append('-f ' + self.options['flac_quality']) else: - args.append('-f -' + self.quality_default) + args.append('-f ' + self.quality_default) else: - args.append('-s -f -' + self.quality_default) + args.append('-s -f ' + self.quality_default) #for tag in self.metadata.keys(): #value = clean_word(self.metadata[tag]) @@ -115,7 +115,7 @@ class FlacExporter(ExporterCore): self.args = self.get_args(options) self.ext = self.get_file_extension() self.args = ' '.join(self.args) - self.command = 'flac %s "%s" -c -' % (self.args, self.source) + self.command = 'sox "%s" -q -w -r 44100 -t wav -c2 - | flac %s -c -' % (self.source, self.args) # Pre-proccessing self.dest = self.pre_process(self.item_id, diff --git a/telemeta/export/mp3.py b/telemeta/export/mp3.py index d25ac769..1f54672d 100644 --- a/telemeta/export/mp3.py +++ b/telemeta/export/mp3.py @@ -44,7 +44,7 @@ class Mp3Exporter(ExporterCore): #'date': 'TYER', #year } self.dub2args_dict = {'title': 'tt', #title2 - 'creator': 'ta', #composer + 'creator': 'ta', #composerS 'relation': 'tl', #album #'type': 'tg', #genre 'publisher': 'tc', #comment @@ -129,8 +129,8 @@ class Mp3Exporter(ExporterCore): self.args = self.get_args(options) self.ext = self.get_file_extension() self.args = ' '.join(self.args) - #self.command = 'sox "%s" -q -w -r 44100 -t wav -c2 - | lame %s -' \ - self.command = 'lame %s "%s" -' % (self.args, self.source) + self.command = 'sox "%s" -q -w -r 44100 -t wav -c2 - | lame %s -' % (self.source, self.args) + #self.command = 'lame %s "%s" -' % (self.args, self.source) # Pre-proccessing self.dest = self.pre_process(self.item_id, @@ -141,7 +141,7 @@ class Mp3Exporter(ExporterCore): self.options) # Processing (streaming + cache writing) - stream = self.core_process(self.command,self.buffer_size,self.dest) + stream = self.core_process(self.command, self.buffer_size, self.dest) for chunk in stream: yield chunk diff --git a/telemeta/export/ogg.py b/telemeta/export/ogg.py index ad357bf3..1189ab30 100644 --- a/telemeta/export/ogg.py +++ b/telemeta/export/ogg.py @@ -109,7 +109,7 @@ class OggExporter(ExporterCore): self.args = self.get_args(options) self.ext = self.get_file_extension() self.args = ' '.join(self.args) - self.command = 'cat "%s" | oggenc %s -' % (self.source, self.args) + self.command = 'sox "%s" -q -w -r 44100 -t wav -c2 - | oggenc %s -' % (self.source, self.args) # Pre-proccessing self.dest = self.pre_process(self.item_id,