Repository navigation
Expand file tree
/
Copy pathPackage.swift
More file actions
137 lines (136 loc) · 5.46 KB
/
Copy pathPackage.swift
File metadata and controls
137 lines (136 loc) · 5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "APlay",
platforms: [
.macOS(.v12),
.iOS(.v15),
.tvOS(.v15),
.visionOS(.v1),
],
products: [
.library(name: "APlay", targets: ["APlay"]),
.library(name: "APlayExtras", targets: ["APlayExtras"]),
.library(name: "APlayWavPack", targets: ["APlayWavPack"]),
.library(name: "APlayVorbis", targets: ["APlayVorbis"]),
.library(name: "APlaySpeex", targets: ["APlaySpeex"]),
// MIDI playback through a SoundFont. Pure Swift on AVFoundation — no
// vendored C — because AVAudioSequencer + AVAudioUnitSampler already
// render Standard MIDI Files to PCM.
.library(name: "APlayMidi", targets: ["APlayMidi"]),
// Opus inside WebM/Matroska. Core Audio has the codec but no AudioFileStream
// parser for the EBML container, so this product demuxes the track in Swift
// and hands the packets to AudioConverter — no vendored C.
.library(name: "APlayOpus", targets: ["APlayOpus"]),
],
targets: [
.target(
name: "APlay",
path: "APlay",
exclude: ["Info.plist"]
),
.target(
name: "APlayExtras",
dependencies: ["APlay"],
path: "APlayExtras"
),
// WavPack decoder, vendored. The C library is pure ANSI C with no
// config header; the wrapper implements `AudioDecoderCompatible` and
// is wired through the same `audioDecoderBuilder` seam as APlayExtras.
.target(
name: "CAPlayWavPack",
path: "Sources/CAPlayWavPack",
publicHeadersPath: "include",
cSettings: [
// The local headers sit next to the sources; the public one is
// reached as <wavpack/wavpack.h>.
.headerSearchPath("."),
.headerSearchPath("include"),
.headerSearchPath("include/wavpack"),
]
),
.target(
name: "APlayWavPack",
dependencies: ["APlay", "CAPlayWavPack"],
path: "Sources/APlayWavPack"
),
// Ogg page/framing layer, shared by every Ogg-carried codec. Pure
// ANSI C; `os_types.h` resolves its integer types per platform without
// a generated config header.
.target(
name: "CAPlayOgg",
path: "Sources/CAPlayOgg",
publicHeadersPath: "include"
),
// Vorbis decoder, vendored. Only the decode side is compiled — the
// encoder (the sole user of `modes/`) is excluded, so no setup tables
// are needed. Reaches libogg through `<ogg/ogg.h>`.
.target(
name: "CAPlayVorbis",
dependencies: ["CAPlayOgg"],
path: "Sources/CAPlayVorbis",
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("."),
]
),
.target(
name: "APlayVorbis",
dependencies: ["APlay", "CAPlayOgg", "CAPlayVorbis"],
path: "Sources/APlayVorbis"
),
// Speex decoder, vendored. Only the decode side is compiled — the
// encoders and the psychoacoustic model (its sole consumer) are
// excluded. Reaches libogg through `<ogg/ogg.h>`. `FLOATING_POINT` is
// the configuration the reference `speexdec` uses.
.target(
name: "CAPlaySpeex",
dependencies: ["CAPlayOgg"],
path: "Sources/CAPlaySpeex",
publicHeadersPath: "include",
cSettings: [
.headerSearchPath("."),
.define("FLOATING_POINT"),
.define("HAVE_CONFIG_H"),
.define("USE_KISS_FFT"),
]
),
.target(
name: "APlaySpeex",
dependencies: ["APlay", "CAPlayOgg", "CAPlaySpeex"],
path: "Sources/APlaySpeex"
),
// Standard MIDI File playback. Core Audio has no MIDI decoder, so this
// product renders the file itself through AVAudioSequencer + an
// AVAudioUnitSampler loaded with a SoundFont, inside an AVAudioEngine
// in offline manual rendering mode. The wrapper implements
// `AudioDecoderCompatible` and is wired through the same
// `audioDecoderBuilder` seam as the vendored codecs.
.target(
name: "APlayMidi",
dependencies: ["APlay"],
path: "Sources/APlayMidi"
),
// WebM/Matroska Opus decoder. The container is demuxed in pure Swift
// (`WebMDemuxer`) and the packets are decoded through Core Audio's Opus
// converter, so no C library is vendored. The wrapper implements
// `AudioDecoderCompatible` and is wired through the same
// `audioDecoderBuilder` seam as the vendored codecs.
.target(
name: "APlayOpus",
dependencies: ["APlay"],
path: "Sources/APlayOpus"
),
.executableTarget(
name: "APlayMacPlayback",
dependencies: ["APlay", "APlayMidi", "APlayOpus", "APlayWavPack", "APlayVorbis", "APlaySpeex"],
path: "MacPlayback"
),
.testTarget(
name: "APlayTests",
dependencies: ["APlay", "APlayExtras", "APlayWavPack", "APlayVorbis", "APlaySpeex", "APlayMidi", "APlayOpus"],
path: "MacTests",
resources: [.copy("Fixtures")]
),
]
)