from .constants import (
AIRPLAY_DISCOVERY_TYPE,
- AIRPLAY_PCM_FORMAT,
+ AIRPLAY_FLOW_PCM_FORMAT,
CACHE_CATEGORY_PREV_VOLUME,
CONF_ACTION_FINISH_PAIRING,
CONF_ACTION_START_PAIRING,
self._attr_current_media = media
# select audio source
- audio_source = self.mass.streams.get_stream(media, AIRPLAY_PCM_FORMAT)
+ audio_source = self.mass.streams.get_stream(media, AIRPLAY_FLOW_PCM_FORMAT)
# if an existing stream session is running, we could replace it with the new stream
if self.stream and self.stream.running:
# setup StreamSession for player (and its sync childs if any)
sync_clients = self._get_sync_clients()
provider = cast("AirPlayProvider", self.provider)
- stream_session = AirPlayStreamSession(provider, sync_clients, AIRPLAY_PCM_FORMAT)
+ stream_session = AirPlayStreamSession(provider, sync_clients, AIRPLAY_FLOW_PCM_FORMAT)
await stream_session.start(audio_source)
async def volume_set(self, volume_level: int) -> None:
from random import randint
from typing import TYPE_CHECKING
-from music_assistant_models.enums import ContentType, PlaybackState
-from music_assistant_models.media_items import AudioFormat
+from music_assistant_models.enums import PlaybackState
from music_assistant.constants import VERBOSE_LOG_LEVEL
from music_assistant.helpers.named_pipe import AsyncNamedPipeWriter
+from music_assistant.providers.airplay.constants import AIRPLAY_PCM_FORMAT
if TYPE_CHECKING:
from music_assistant_models.player import PlayerMedia
session: AirPlayStreamSession | None = None # reference to the active stream session (if any)
# the pcm audio format used for streaming to this protocol
- pcm_format = AudioFormat(
- content_type=ContentType.PCM_S16LE, sample_rate=44100, bit_depth=16, channels=2
- )
+ pcm_format = AIRPLAY_PCM_FORMAT
supports_pairing = False # whether this protocol supports pairing
is_pairing: bool = False # whether this protocol instance is in pairing mode