From bfdd80a812678b844f0258fb73342515bc89cb0f Mon Sep 17 00:00:00 2001 From: yomguy <> Date: Mon, 21 May 2007 20:52:51 +0000 Subject: [PATCH] Restore Jeroen Wijering's Flash MP3 Player --- telemeta/export/flac.py | 36 +++++++++++++++++++++++ telemeta/templates/collection_detail.html | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/telemeta/export/flac.py b/telemeta/export/flac.py index 972938a3..43c3d623 100644 --- a/telemeta/export/flac.py +++ b/telemeta/export/flac.py @@ -119,16 +119,52 @@ class FlacExporter(ExporterCore): self.ext, self.cache_dir, self.options) +<<<<<<< .mine + + # Initializing + + command = 'sox "'+self.source+'" -q -w -r 44100 -t wav -c2 - '+ + '| flac '+args+' -c -' + + chunk = 0 + file_out = open(self.dest,'w') + + # Processing + proc = subprocess.Popen(command, + shell=True, + bufsize=self.buffer_size, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + close_fds=True) +======= except: yield 'ExporterError [3]: pre_process' +>>>>>>> .r109 + +<<<<<<< .mine + chunk = proc.stdout.read(self.buffer_size) + yield chunk + file_out.write(chunk) + # Streaming + while chunk: + chunk = proc.stdout.read(self.buffer_size) +======= # Processing (streaming + cache writing) try: stream = self.core_process(self.command,self.buffer_size,self.dest) for chunk in stream: +>>>>>>> .r109 yield chunk +<<<<<<< .mine + file_out.write(chunk) + + #file_in.close() + file_out.close() +======= except: yield 'ExporterError: core_process' +>>>>>>> .r109 # Post-proccessing try: diff --git a/telemeta/templates/collection_detail.html b/telemeta/templates/collection_detail.html index 5e37e3a3..55361774 100644 --- a/telemeta/templates/collection_detail.html +++ b/telemeta/templates/collection_detail.html @@ -17,7 +17,7 @@

Listen to this collection (M3U, XSPF)

- {% if 1 %} {# Use 1/0 for alternate player #} + {% if 0 %} {# Use 1/0 for alternate player #}