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-parityfecsubtype.Declaration
Swift
case _1dInterleavedParityfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
32kadpcmsubtype.Declaration
Swift
case _32kadpcm(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
3gppsubtype.Declaration
Swift
case _3gpp(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
3gpp2subtype.Declaration
Swift
case _3gpp2(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
aacsubtype.Declaration
Swift
case aac(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ac3subtype.Declaration
Swift
case ac3(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
AMRsubtype.Declaration
Swift
case AMR(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
AMR-WBsubtype.Declaration
Swift
case AMRWB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
amr-wbsubtype.Declaration
Swift
case amrWb(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
aptxsubtype.Declaration
Swift
case aptx(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ascsubtype.Declaration
Swift
case asc(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ATRAC-ADVANCED-LOSSLESSsubtype.Declaration
Swift
case ATRACADVANCEDLOSSLESS(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ATRAC-Xsubtype.Declaration
Swift
case ATRACX(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ATRAC3subtype.Declaration
Swift
case ATRAC3(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
basicsubtype.Declaration
Swift
case basic(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
BV16subtype.Declaration
Swift
case BV16(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
BV32subtype.Declaration
Swift
case BV32(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
clearmodesubtype.Declaration
Swift
case clearmode(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
CNsubtype.Declaration
Swift
case CN(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
DAT12subtype.Declaration
Swift
case DAT12(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dlssubtype.Declaration
Swift
case dls(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dsr-es201108subtype.Declaration
Swift
case dsrEs201108(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dsr-es202050subtype.Declaration
Swift
case dsrEs202050(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dsr-es202211subtype.Declaration
Swift
case dsrEs202211(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
dsr-es202212subtype.Declaration
Swift
case dsrEs202212(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
DVsubtype.Declaration
Swift
case DV(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
DVI4subtype.Declaration
Swift
case DVI4(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
eac3subtype.Declaration
Swift
case eac3(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
encaprtpsubtype.Declaration
Swift
case encaprtp(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCsubtype.Declaration
Swift
case EVRC(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRC-QCPsubtype.Declaration
Swift
case EVRCQCP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRC0subtype.Declaration
Swift
case EVRC0(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRC1subtype.Declaration
Swift
case EVRC1(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCBsubtype.Declaration
Swift
case EVRCB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCB0subtype.Declaration
Swift
case EVRCB0(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCB1subtype.Declaration
Swift
case EVRCB1(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCNWsubtype.Declaration
Swift
case EVRCNW(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCNW0subtype.Declaration
Swift
case EVRCNW0(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCNW1subtype.Declaration
Swift
case EVRCNW1(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCWBsubtype.Declaration
Swift
case EVRCWB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCWB0subtype.Declaration
Swift
case EVRCWB0(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVRCWB1subtype.Declaration
Swift
case EVRCWB1(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
EVSsubtype.Declaration
Swift
case EVS(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
examplesubtype.Declaration
Swift
case example(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
flexfecsubtype.Declaration
Swift
case flexfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
fwdredsubtype.Declaration
Swift
case fwdred(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G711-0subtype.Declaration
Swift
case G7110(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G719subtype.Declaration
Swift
case G719(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G7221subtype.Declaration
Swift
case G7221(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G722subtype.Declaration
Swift
case G722(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G723subtype.Declaration
Swift
case G723(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G726-16subtype.Declaration
Swift
case G72616(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G726-24subtype.Declaration
Swift
case G72624(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G726-32subtype.Declaration
Swift
case G72632(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G726-40subtype.Declaration
Swift
case G72640(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G728subtype.Declaration
Swift
case G728(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G729subtype.Declaration
Swift
case G729(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G7291subtype.Declaration
Swift
case G7291(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G729Dsubtype.Declaration
Swift
case G729D(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
G729Esubtype.Declaration
Swift
case G729E(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
GSMsubtype.Declaration
Swift
case GSM(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
GSM-EFRsubtype.Declaration
Swift
case GSMEFR(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
GSM-HR-08subtype.Declaration
Swift
case GSMHR08(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
iLBCsubtype.Declaration
Swift
case iLBC(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
L8subtype.Declaration
Swift
case L8(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
L16subtype.Declaration
Swift
case L16(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
L20subtype.Declaration
Swift
case L20(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
L24subtype.Declaration
Swift
case L24(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
LPCsubtype.Declaration
Swift
case LPC(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MELPsubtype.Declaration
Swift
case MELP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MELP600subtype.Declaration
Swift
case MELP600(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MELP1200subtype.Declaration
Swift
case MELP1200(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MELP2400subtype.Declaration
Swift
case MELP2400(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mhassubtype.Declaration
Swift
case mhas(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mobile-xmfsubtype.Declaration
Swift
case mobileXmf(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MPAsubtype.Declaration
Swift
case MPA(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mp4subtype.Declaration
Swift
case mp4(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
MP4A-LATMsubtype.Declaration
Swift
case MP4ALATM(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mpa-robustsubtype.Declaration
Swift
case mpaRobust(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mpegsubtype.Declaration
Swift
case mpeg(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
mpeg4-genericsubtype.Declaration
Swift
case mpeg4Generic(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
oggsubtype.Declaration
Swift
case ogg(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
opussubtype.Declaration
Swift
case opus(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
parityfecsubtype.Declaration
Swift
case parityfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
PCMAsubtype.Declaration
Swift
case PCMA(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
PCMA-WBsubtype.Declaration
Swift
case PCMAWB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
PCMUsubtype.Declaration
Swift
case PCMU(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
PCMU-WBsubtype.Declaration
Swift
case PCMUWB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
QCELPsubtype.Declaration
Swift
case QCELP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
raptorfecsubtype.Declaration
Swift
case raptorfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
REDsubtype.Declaration
Swift
case RED(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtp-enc-aescm128subtype.Declaration
Swift
case rtpEncAescm128(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtploopbacksubtype.Declaration
Swift
case rtploopback(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtp-midisubtype.Declaration
Swift
case rtpMidi(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
rtxsubtype.Declaration
Swift
case rtx(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
scipsubtype.Declaration
Swift
case scip(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
SMVsubtype.Declaration
Swift
case SMV(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
SMV0subtype.Declaration
Swift
case SMV0(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
SMV-QCPsubtype.Declaration
Swift
case SMVQCP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
sofasubtype.Declaration
Swift
case sofa(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
sp-midisubtype.Declaration
Swift
case spMidi(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
speexsubtype.Declaration
Swift
case speex(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
t140csubtype.Declaration
Swift
case t140c(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
t38subtype.Declaration
Swift
case t38(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
telephone-eventsubtype.Declaration
Swift
case telephoneEvent(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
TETRA_ACELPsubtype.Declaration
Swift
case TETRA_ACELP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
TETRA_ACELP_BBsubtype.Declaration
Swift
case TETRA_ACELP_BB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
tonesubtype.Declaration
Swift
case tone(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
TSVCISsubtype.Declaration
Swift
case TSVCIS(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
UEMCLIPsubtype.Declaration
Swift
case UEMCLIP(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
ulpfecsubtype.Declaration
Swift
case ulpfec(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
usacsubtype.Declaration
Swift
case usac(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
VDVIsubtype.Declaration
Swift
case VDVI(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
VMR-WBsubtype.Declaration
Swift
case VMRWB(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
vorbissubtype.Declaration
Swift
case vorbis(_: Suffix? = nil, _: Parameters? = nil) -
Represents the
vorbis-configsubtype.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
SuffixandParameters.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)