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
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"))
# 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