diff --git a/flac.py b/flac.py index 2c71f9a..578fb27 100644 --- a/flac.py +++ b/flac.py @@ -43,7 +43,12 @@ except OSError: array.array('h', [ inbuf[chanmap[x % nchan]][x / nchan] for x in xrange(blksize * nchan)]) -flaclib = CDLL('libFLAC.so') +try: + flaclib = CDLL('libFLAC.so') +except OSError, e: + import warnings + warnings.warn('libFLAC.so not installed. FLAC decoding not available.') + raise ImportError(str(e)) # Defines