# -*- coding: utf-8 -*-
#
-# Copyright (C) 2007 Parisson SARL
+# Copyright (C) 2008 Parisson SARL
# Copyright (c) 2006-2007 Guillaume Pellerin <pellerin@parisson.com>
# All rights reserved.
#
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 = ''
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])
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,
#'date': 'TYER', #year
}
self.dub2args_dict = {'title': 'tt', #title2
- 'creator': 'ta', #composer
+ 'creator': 'ta', #composerS
'relation': 'tl', #album
#'type': 'tg', #genre
'publisher': 'tc', #comment
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,
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
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,