From dfee17045dc8795411095bcfeb96b65bf1c81ce1 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 13 Aug 2013 16:12:07 +0100 Subject: [PATCH] Broken push to get vagrant install running --- .gitignore | 1 + requirements.txt | 3 +++ spa/management/commands/create_waveforms.py | 15 +++++++++++++++ spa/management/commands/waveforms.py | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 spa/management/commands/create_waveforms.py diff --git a/.gitignore b/.gitignore index 7ba85f9..cb3cac1 100755 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ downloads.txt plays.txt dss_ah fixtures.json +dss_test.db diff --git a/requirements.txt b/requirements.txt index 7012961..571629f 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ Django==1.5 PIL>=1.1.7 +numpy +pygtk +timeside south beautifulsoup4>=4.1.1 decorator>=3.3.3 diff --git a/spa/management/commands/create_waveforms.py b/spa/management/commands/create_waveforms.py new file mode 100644 index 0000000..d41ebee --- /dev/null +++ b/spa/management/commands/create_waveforms.py @@ -0,0 +1,15 @@ +from django.core.management.base import NoArgsCommand +import timeside + + +class Command(NoArgsCommand): + def handle_noargs(self, **options): + try: + audio_file = 'spring.mp3' + decoder = timeside.decoder.FileDecoder(audio_file) + grapher = timeside.grapher.Spectrogram(width=1920, height=1080) + (decoder | grapher).run() + grapher.render('d:\spectrogram.png') + + except Exception, ex: + print "Debug exception: %s" % ex.message \ No newline at end of file diff --git a/spa/management/commands/waveforms.py b/spa/management/commands/waveforms.py index d67abc4..f1c611d 100755 --- a/spa/management/commands/waveforms.py +++ b/spa/management/commands/waveforms.py @@ -12,7 +12,7 @@ class Command(NoArgsCommand): in_file = mix.get_absolute_path() try: if os.path.isfile(in_file): - create_waveform_task.delay(in_file=in_file, mix_uid=mix.uid) + create_waveform_task.delay(in_file=in_file, uid=mix.uid) else: print "File %s not found" % in_file