Update http_streamer.py
authormarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sat, 19 Oct 2019 08:22:01 +0000 (10:22 +0200)
committermarcelveldt <marcelvanderveldt@MacBook-Silvia.local>
Sat, 19 Oct 2019 08:22:01 +0000 (10:22 +0200)
music_assistant/http_streamer.py

index 464aded716755e8aa0a2b1d01fa32c9cd8a18bd6..20d8646db2ca034eeaf5e0f522ba3b26129d91a4 100755 (executable)
@@ -45,8 +45,7 @@ class HTTPStreamer():
         # prepare headers as audio/flac content
         resp = web.StreamResponse(status=200, reason='OK', 
                 headers={
-                    'Content-Type': 'audio/mp3' if player.player_provider else 'audio/flac',
-                    'Accept-Ranges': 'None'
+                    'Content-Type': 'audio/flac'
                     })
         await resp.prepare(http_request)
         # send content only on GET request
@@ -116,10 +115,7 @@ class HTTPStreamer():
         else:
             fade_bytes = int(sample_rate * 4 * 2)
         pcm_args = 'raw -b 32 -c 2 -e signed-integer -r %s' % sample_rate
-        if player.player_provider == 'web':
-            args = 'sox -t %s - -t flac -C 0 -' % pcm_args
-        else:
-             args = 'sox -t %s - -t mp3 -' % pcm_args
+        args = 'sox -t %s - -t flac -C 0 -' % pcm_args
         # start sox process
         # we use normal subprocess instead of asyncio because of bug with executor
         # this should be fixed with python 3.8