Wave Decoder was not passing the correct exception on failure to load a source.
"""
from __future__ import absolute_import, division
-from ..exceptions import MediaFormatException
+from ..exceptions import MediaDecodeException
from .base import StreamingSource, AudioData, AudioFormat, StaticSource
from . import MediaEncoder, MediaDecoder
import wave
-class WAVEFormatException(MediaFormatException):
+class WAVEDecodeException(MediaDecodeException):
pass
@@ -58,10 +58,10 @@ class WaveSource(StreamingSource):
try:
self._wave = wave.open(file)
except wave.Error as e:
- raise WAVEFormatException(e)
+ raise WAVEDecodeException(e)
+ # PYTHON2 - named tuple can be used instead of explicit unpacking:
# parameters = self._wave.getparams()
- # (nchannels=1, sampwidth=2, framerate=22050, nframes=11583, comptype='NONE', compname='not compressed')
nchannels, sampwidth, framerate, nframes, comptype, compname = self._wave.getparams()
self.audio_format = AudioFormat(channels=nchannels,
