From: yomguy Date: Mon, 30 Nov 2009 08:36:23 +0000 (+0000) Subject: encoder : replace sox by ffmpeg for decoding (buggy now for flac and wav encoding) X-Git-Tag: 0.3.2~214 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=475a2d708173a6356a8c3652a2f13c741d530abc;p=timeside.git encoder : replace sox by ffmpeg for decoding (buggy now for flac and wav encoding) --- diff --git a/decode/core.py b/decode/core.py index c7a5afe..158143d 100644 --- a/decode/core.py +++ b/decode/core.py @@ -60,7 +60,7 @@ class DecoderCore(Processor): paths, metadata parsing, data streaming thru system command""" def __init__(self): - self.command = 'sox "%s" -q -b 16 -r 44100 -t wav -c2 - ' + self.command = 'ffmpeg -i "%s" -f wav - ' def process(self, source, options=None): """Encode and stream audio data through a generator""" diff --git a/encode/flac.py b/encode/flac.py index c03eb93..256c7a7 100644 --- a/encode/flac.py +++ b/encode/flac.py @@ -127,7 +127,7 @@ class FlacEncoder(EncoderCore): #temp_file.flush() pass - self.write_tags(temp_file.name) + #self.write_tags(temp_file.name) while True: __chunk = temp_file.read(buffer_size) diff --git a/tests/samples/sweep_source.wav b/tests/samples/sweep_source.wav new file mode 100644 index 0000000..9c2febe Binary files /dev/null and b/tests/samples/sweep_source.wav differ diff --git a/tests/test.py b/tests/test.py index c54b449..7ae70e3 100755 --- a/tests/test.py +++ b/tests/test.py @@ -92,6 +92,7 @@ class TestEncoders: def run(self, source, metadata): print '\n=== Encoder testing ===\n' for encoder_class in self.encoders: + print '==================================' encoder = encoder_class() mime = mimetype(source) format = encoder.format() @@ -106,6 +107,7 @@ class TestEncoders: file.write(chunk) print 'Sound exported to :' + file_path file.close() + print '==================================\n' class TestGraphers: