From 6f4ccd17a76ec9e205599c6c190056c195358f28 Mon Sep 17 00:00:00 2001 From: fergalmoran Date: Fri, 19 Apr 2013 16:16:03 +0100 Subject: [PATCH] Changed waveform generating algorithm to use wav2png --- core/utils/waveform.py | 4 ++-- dss/logsettings.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/utils/waveform.py b/core/utils/waveform.py index f548df3..5e2c0e2 100644 --- a/core/utils/waveform.py +++ b/core/utils/waveform.py @@ -16,14 +16,14 @@ def generate_waveform(input_file, output_file): print "Starting waveform generation" #print "%s -m -l -i %s -o -b 000000 %s" % (settings.DSS_WAVE_PATH, working_file, output_file) #subprocess.call([settings.DSS_WAVE_PATH, "-t", "-m", "-l", "-i", working_file, "-o", output_file]) - subprocess.call([settings.DSS_WAVE_PATH, "-w 800", "-h 120", "-o %s" % output_file, working_file]) - + ret = subprocess.call(["/usr/local/bin/wav2png", "-w", "800", "-h", "120", "-o", output_file, working_file], stderr=subprocess.PIPE, stdout=subprocess.PIPE) if os.path.isfile(output_file): os.remove(working_file) print "Generated waveform" return output_file else: print "Failed generating waveform: %s" % output_file + print "Subprocess returned: %s" % ret else: print "Unable to find working file, did LAME succeed?" return "" diff --git a/dss/logsettings.py b/dss/logsettings.py index 21ba82e..eb99d91 100644 --- a/dss/logsettings.py +++ b/dss/logsettings.py @@ -1,5 +1,5 @@ import os - +import localsettings if os.name == 'posix': LOG_FILE = '/tmp/dss.log' else: @@ -39,6 +39,10 @@ LOGGING = { 'level': 'ERROR', 'propagate': True, }, + 'django.db.backends': { + 'level': 'DEBUG', + 'handers': ['console'], + }, } }