From: Marcel van der Veldt Date: Wed, 11 May 2022 11:39:40 +0000 (+0200) Subject: Add support for m4a audio container (#303) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=00e57cd48e57abe1ee0763d1474977be1f7ee6ed;p=music-assistant-server.git Add support for m4a audio container (#303) --- diff --git a/music_assistant/models/enums.py b/music_assistant/models/enums.py index 5c03dccf..52b8a259 100644 --- a/music_assistant/models/enums.py +++ b/music_assistant/models/enums.py @@ -79,14 +79,18 @@ class StreamType(Enum): class ContentType(Enum): - """Enum with audio content types supported by ffmpeg.""" + """Enum with audio content/container types supported by ffmpeg.""" OGG = "ogg" FLAC = "flac" MP3 = "mp3" AAC = "aac" MPEG = "mpeg" - WAV = "wav" + ALAC = "alac" + WAVE = "wave" + AIFF = "aiff" + WMA = "wma" + M4A = "m4a" PCM_S16LE = "s16le" # PCM signed 16-bit little-endian PCM_S24LE = "s24le" # PCM signed 24-bit little-endian PCM_S32LE = "s32le" # PCM signed 32-bit little-endian @@ -114,7 +118,13 @@ class ContentType(Enum): def sox_supported(self): """Return if ContentType is supported by SoX.""" - return self not in [ContentType.AAC, ContentType.MPEG] + return self.is_pcm() or self in [ + ContentType.OGG, + ContentType.FLAC, + ContentType.MP3, + ContentType.WAVE, + ContentType.AIFF, + ] def sox_format(self): """Convert the ContentType to SoX compatible format.""" diff --git a/music_assistant/models/player.py b/music_assistant/models/player.py index 3cf6b840..61ab6147 100755 --- a/music_assistant/models/player.py +++ b/music_assistant/models/player.py @@ -23,7 +23,7 @@ DEFAULT_SUPPORTED_CONTENT_TYPES = ( # if a player does not report/set its supported content types, we use a pretty safe default ContentType.FLAC, ContentType.MP3, - ContentType.WAV, + ContentType.WAVE, ContentType.PCM_S16LE, ContentType.PCM_S24LE, ) diff --git a/music_assistant/models/player_queue.py b/music_assistant/models/player_queue.py index 3c57f017..9fcad8d0 100644 --- a/music_assistant/models/player_queue.py +++ b/music_assistant/models/player_queue.py @@ -195,7 +195,7 @@ class QueueSettings: x for x in ( ContentType.FLAC, - ContentType.WAV, + ContentType.WAVE, ContentType.PCM_S16LE, ContentType.MP3, ContentType.MPEG,