Update http_streamer.py
authormarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sun, 13 Oct 2019 21:01:09 +0000 (23:01 +0200)
committermarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sun, 13 Oct 2019 21:01:09 +0000 (23:01 +0200)
music_assistant/http_streamer.py

index f2b35e8ee6f2cd8749e2f89de12bc3e04503ab67..966eb207b238d0af5d6d1dca58ff8c12651f809d 100755 (executable)
@@ -9,7 +9,6 @@ import threading
 import urllib
 from memory_tempfile import MemoryTempfile
 import io
-import pyloudnorm as pyln
 import aiohttp
 from .utils import LOGGER, try_parse_int, get_ip, run_async_background_task, run_periodic, get_folder_size
 from .models.media_types import TrackQuality, MediaType
@@ -397,8 +396,9 @@ class HTTPStreamer():
             # calculate BS.1770 R128 integrated loudness
             try:
                 import soundfile as sf
+                import pyloudnorm as pyln
             except Exception as exc:
-                LOGGER.exception("Could not import soundfile, skip analyze job")
+                LOGGER.exception("Could not import soundfile or pyloudnorm, skip analyze job - %s" % str(exc))
                 return
             if track_loudness == None:
                 with io.BytesIO(audio_data) as tmpfile: