Audio
public enum Audio
extension Audio: CustomStringConvertible
extension Audio: RawRepresentable
extension Audio: MediaSubtype
extension Audio: Hashable
Represents the audio
media type. See the
official documentation for details.
You typically use Audio
as a MediaType
.
let audio = Audio.ac3(nil, ["rate": 32000])
let mediaType = MediaType.audio(audio) // Creates: audio/ac3;rate=32000
You can use standard switch
statement to access audio values.
func isSupported(audio: Audio) -> Bool {
switch audio {
case .ac3, .aac, .ogg: return true
default: return false
}
}
isSupported(audio: .ac3()) // Returns: true
isSupported(audio: .aac()) // Returns: true
isSupported(audio: .ogg()) // Returns: true
isSupported(audio: .mpeg()) // Returns: false
See also
MediaType
-
Represents the
1d-interleaved-parityfec
subtype.Declaration
Swift
case _1dInterleavedParityfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
32kadpcm
subtype.Declaration
Swift
case _32kadpcm(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
3gpp
subtype.Declaration
Swift
case _3gpp(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
3gpp2
subtype.Declaration
Swift
case _3gpp2(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
aac
subtype.Declaration
Swift
case aac(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ac3
subtype.Declaration
Swift
case ac3(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
AMR
subtype.Declaration
Swift
case AMR(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
AMR-WB
subtype.Declaration
Swift
case AMRWB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
amr-wb
subtype.Declaration
Swift
case amrWb(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
aptx
subtype.Declaration
Swift
case aptx(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
asc
subtype.Declaration
Swift
case asc(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ATRAC-ADVANCED-LOSSLESS
subtype.Declaration
Swift
case ATRACADVANCEDLOSSLESS(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ATRAC-X
subtype.Declaration
Swift
case ATRACX(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ATRAC3
subtype.Declaration
Swift
case ATRAC3(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
basic
subtype.Declaration
Swift
case basic(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
BV16
subtype.Declaration
Swift
case BV16(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
BV32
subtype.Declaration
Swift
case BV32(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
clearmode
subtype.Declaration
Swift
case clearmode(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
CN
subtype.Declaration
Swift
case CN(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
DAT12
subtype.Declaration
Swift
case DAT12(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dls
subtype.Declaration
Swift
case dls(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dsr-es201108
subtype.Declaration
Swift
case dsrEs201108(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dsr-es202050
subtype.Declaration
Swift
case dsrEs202050(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dsr-es202211
subtype.Declaration
Swift
case dsrEs202211(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
dsr-es202212
subtype.Declaration
Swift
case dsrEs202212(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
DV
subtype.Declaration
Swift
case DV(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
DVI4
subtype.Declaration
Swift
case DVI4(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
eac3
subtype.Declaration
Swift
case eac3(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
encaprtp
subtype.Declaration
Swift
case encaprtp(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRC
subtype.Declaration
Swift
case EVRC(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRC-QCP
subtype.Declaration
Swift
case EVRCQCP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRC0
subtype.Declaration
Swift
case EVRC0(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRC1
subtype.Declaration
Swift
case EVRC1(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCB
subtype.Declaration
Swift
case EVRCB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCB0
subtype.Declaration
Swift
case EVRCB0(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCB1
subtype.Declaration
Swift
case EVRCB1(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCNW
subtype.Declaration
Swift
case EVRCNW(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCNW0
subtype.Declaration
Swift
case EVRCNW0(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCNW1
subtype.Declaration
Swift
case EVRCNW1(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCWB
subtype.Declaration
Swift
case EVRCWB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCWB0
subtype.Declaration
Swift
case EVRCWB0(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVRCWB1
subtype.Declaration
Swift
case EVRCWB1(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
EVS
subtype.Declaration
Swift
case EVS(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
example
subtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
flexfec
subtype.Declaration
Swift
case flexfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
fwdred
subtype.Declaration
Swift
case fwdred(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G711-0
subtype.Declaration
Swift
case G7110(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G719
subtype.Declaration
Swift
case G719(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G7221
subtype.Declaration
Swift
case G7221(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G722
subtype.Declaration
Swift
case G722(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G723
subtype.Declaration
Swift
case G723(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G726-16
subtype.Declaration
Swift
case G72616(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G726-24
subtype.Declaration
Swift
case G72624(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G726-32
subtype.Declaration
Swift
case G72632(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G726-40
subtype.Declaration
Swift
case G72640(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G728
subtype.Declaration
Swift
case G728(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G729
subtype.Declaration
Swift
case G729(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G7291
subtype.Declaration
Swift
case G7291(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G729D
subtype.Declaration
Swift
case G729D(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
G729E
subtype.Declaration
Swift
case G729E(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
GSM
subtype.Declaration
Swift
case GSM(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
GSM-EFR
subtype.Declaration
Swift
case GSMEFR(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
GSM-HR-08
subtype.Declaration
Swift
case GSMHR08(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
iLBC
subtype.Declaration
Swift
case iLBC(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
L8
subtype.Declaration
Swift
case L8(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
L16
subtype.Declaration
Swift
case L16(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
L20
subtype.Declaration
Swift
case L20(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
L24
subtype.Declaration
Swift
case L24(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
LPC
subtype.Declaration
Swift
case LPC(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MELP
subtype.Declaration
Swift
case MELP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MELP600
subtype.Declaration
Swift
case MELP600(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MELP1200
subtype.Declaration
Swift
case MELP1200(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MELP2400
subtype.Declaration
Swift
case MELP2400(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mhas
subtype.Declaration
Swift
case mhas(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mobile-xmf
subtype.Declaration
Swift
case mobileXmf(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MPA
subtype.Declaration
Swift
case MPA(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mp4
subtype.Declaration
Swift
case mp4(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
MP4A-LATM
subtype.Declaration
Swift
case MP4ALATM(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mpa-robust
subtype.Declaration
Swift
case mpaRobust(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mpeg
subtype.Declaration
Swift
case mpeg(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
mpeg4-generic
subtype.Declaration
Swift
case mpeg4Generic(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ogg
subtype.Declaration
Swift
case ogg(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
opus
subtype.Declaration
Swift
case opus(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
parityfec
subtype.Declaration
Swift
case parityfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
PCMA
subtype.Declaration
Swift
case PCMA(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
PCMA-WB
subtype.Declaration
Swift
case PCMAWB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
PCMU
subtype.Declaration
Swift
case PCMU(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
PCMU-WB
subtype.Declaration
Swift
case PCMUWB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
QCELP
subtype.Declaration
Swift
case QCELP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
raptorfec
subtype.Declaration
Swift
case raptorfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
RED
subtype.Declaration
Swift
case RED(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtp-enc-aescm128
subtype.Declaration
Swift
case rtpEncAescm128(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtploopback
subtype.Declaration
Swift
case rtploopback(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtp-midi
subtype.Declaration
Swift
case rtpMidi(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
rtx
subtype.Declaration
Swift
case rtx(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
scip
subtype.Declaration
Swift
case scip(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
SMV
subtype.Declaration
Swift
case SMV(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
SMV0
subtype.Declaration
Swift
case SMV0(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
SMV-QCP
subtype.Declaration
Swift
case SMVQCP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
sofa
subtype.Declaration
Swift
case sofa(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
sp-midi
subtype.Declaration
Swift
case spMidi(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
speex
subtype.Declaration
Swift
case speex(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
t140c
subtype.Declaration
Swift
case t140c(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
t38
subtype.Declaration
Swift
case t38(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
telephone-event
subtype.Declaration
Swift
case telephoneEvent(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
TETRA_ACELP
subtype.Declaration
Swift
case TETRA_ACELP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
TETRA_ACELP_BB
subtype.Declaration
Swift
case TETRA_ACELP_BB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
tone
subtype.Declaration
Swift
case tone(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
TSVCIS
subtype.Declaration
Swift
case TSVCIS(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
UEMCLIP
subtype.Declaration
Swift
case UEMCLIP(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
ulpfec
subtype.Declaration
Swift
case ulpfec(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
usac
subtype.Declaration
Swift
case usac(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
VDVI
subtype.Declaration
Swift
case VDVI(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
VMR-WB
subtype.Declaration
Swift
case VMRWB(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
vorbis
subtype.Declaration
Swift
case vorbis(_: Suffix? = nil, _: Parameters? = nil)
-
Represents the
vorbis-config
subtype.Declaration
Swift
case vorbisConfig(_: Suffix? = nil, _: Parameters? = nil)
-
Represents a subtype that does not fit in the other cases or is currently not officially defined.
You can use this case to define an arbitrary, unregistered subtype with the given name or to represent a subtype in the non standard tree, e.g. vendor tree or personal tree.
Optionally, you can specify a
Suffix
andParameters
.Declaration
Swift
case other(String, _: Suffix? = nil, _: Parameters? = nil)
-
Declaration
Swift
case anything(_: Suffix? = nil, _: Parameters? = nil)
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public init(rawValue: String)
-
Declaration
Swift
public var rawValue: String { get }
-
Declaration
Swift
public var type: MediaType { get }
-
Declaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)