forked from DRMTalks/devine
Add FLAC to the Audio Codecs enum and relevant methods
This commit is contained in:
parent
e3941e4640
commit
1c5099440b
|
@ -13,9 +13,10 @@ class Audio(Track):
|
||||||
AC3 = "DD" # https://wikipedia.org/wiki/Dolby_Digital
|
AC3 = "DD" # https://wikipedia.org/wiki/Dolby_Digital
|
||||||
EC3 = "DD+" # https://wikipedia.org/wiki/Dolby_Digital_Plus
|
EC3 = "DD+" # https://wikipedia.org/wiki/Dolby_Digital_Plus
|
||||||
OPUS = "OPUS" # https://wikipedia.org/wiki/Opus_(audio_format)
|
OPUS = "OPUS" # https://wikipedia.org/wiki/Opus_(audio_format)
|
||||||
OGG = "VORB" # https://wikipedia.org/wiki/Vorbis
|
OGG = "VORB" # https://wikipedia.org/wiki/Vorbis
|
||||||
DTS = "DTS" # https://en.wikipedia.org/wiki/DTS_(company)#DTS_Digital_Surround
|
DTS = "DTS" # https://en.wikipedia.org/wiki/DTS_(company)#DTS_Digital_Surround
|
||||||
ALAC = "ALAC" # https://en.wikipedia.org/wiki/Apple_Lossless_Audio_Codec
|
ALAC = "ALAC" # https://en.wikipedia.org/wiki/Apple_Lossless_Audio_Codec
|
||||||
|
FLAC = "FLAC" # https://en.wikipedia.org/wiki/FLAC
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extension(self) -> str:
|
def extension(self) -> str:
|
||||||
|
@ -36,6 +37,8 @@ class Audio(Track):
|
||||||
return Audio.Codec.DTS
|
return Audio.Codec.DTS
|
||||||
if mime == "alac":
|
if mime == "alac":
|
||||||
return Audio.Codec.ALAC
|
return Audio.Codec.ALAC
|
||||||
|
if mime == "flac":
|
||||||
|
return Audio.Codec.FLAC
|
||||||
raise ValueError(f"The MIME '{mime}' is not a supported Audio Codec")
|
raise ValueError(f"The MIME '{mime}' is not a supported Audio Codec")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue