From 57df92d1a0866f9335fe55597d1359ac60cc0711 Mon Sep 17 00:00:00 2001
From: Ben Sturmfels <ben@sturm.com.au>
Date: Fri, 23 Sep 2016 17:14:42 +1000
Subject: [PATCH] Temporary fix to allow audio processing to proceed without
audiolab.
---
extlib/freesound/audioprocessing.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/extlib/freesound/audioprocessing.py b/extlib/freesound/audioprocessing.py
index 7ef8d5d..331f19a 100644
a
|
b
|
try:
|
44 | 44 | import scikits.audiolab as audiolab |
45 | 45 | except ImportError: |
46 | 46 | print("WARNING: audiolab is not installed so wav2png will not work") |
| 47 | class MockSndfile(object): |
| 48 | def __init__(self, *args, **kwargs): |
| 49 | self.nframes = 0 |
| 50 | self.channels = 1 |
| 51 | self.samplerate = 44100 |
| 52 | |
| 53 | def read_frames(self, *args): |
| 54 | return [] |
| 55 | |
| 56 | def seek(self, *args): |
| 57 | return |
| 58 | |
| 59 | def close(self): |
| 60 | return |
| 61 | import unittest.mock as mock |
| 62 | audiolab = mock.Mock() |
| 63 | audiolab.Sndfile = MockSndfile |
47 | 64 | import subprocess |
48 | 65 | |
49 | 66 | class AudioProcessingException(Exception): |