Correct Resonate flow pcm format
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 18:36:19 +0000 (19:36 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 3 Nov 2025 18:36:19 +0000 (19:36 +0100)
music_assistant/providers/resonate/player.py

index 1ebd79d85b32a1fe84660ab54538e0ec30ecffad..92ece5db6c3ed3580aa0df9c8d452d84851f5682 100644 (file)
@@ -46,6 +46,7 @@ from music_assistant.constants import (
     CONF_ENTRY_FLOW_MODE_ENFORCED,
     CONF_ENTRY_OUTPUT_CODEC,
     CONF_OUTPUT_CODEC,
+    INTERNAL_PCM_FORMAT,
 )
 from music_assistant.helpers.audio import get_player_filter_params
 from music_assistant.helpers.ffmpeg import get_ffmpeg_stream
@@ -213,9 +214,12 @@ class ResonatePlayer(Player):
                 bit_depth=16,
                 channels=2,
             )
-
-            # select audio source
-            audio_source = self.mass.streams.get_stream(media, pcm_format)
+            flow_pcm_format = AudioFormat(
+                content_type=INTERNAL_PCM_FORMAT.content_type,
+                sample_rate=pcm_format.sample_rate,
+                bit_depth=INTERNAL_PCM_FORMAT.bit_depth,
+                channels=pcm_format.channels,
+            )
 
             output_codec = cast("str", self.config.get_value(CONF_OUTPUT_CODEC, "pcm"))
 
@@ -224,8 +228,8 @@ class ResonatePlayer(Player):
 
             # Apply DSP and other audio filters
             audio_source = get_ffmpeg_stream(
-                audio_input=audio_source,
-                input_format=pcm_format,
+                audio_input=self.mass.streams.get_stream(media, flow_pcm_format),
+                input_format=flow_pcm_format,
                 output_format=pcm_format,
                 filter_params=get_player_filter_params(
                     self.mass, self.player_id, pcm_format, pcm_format