@motionscript/audio 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +92 -0
- package/dist/browser/chunks/chunk-DAFIVUTT.js +2 -0
- package/dist/browser/chunks/chunk-DAFIVUTT.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +2 -2
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +3 -2
- package/dist/index.js.map +1 -1
- package/dist/kit.js.map +1 -1
- package/dist/nodes.js.map +1 -1
- package/dist/waveform/envelope.d.ts +42 -9
- package/dist/waveform/envelope.d.ts.map +1 -1
- package/dist/waveform/envelope.js +34 -4
- package/dist/waveform/envelope.js.map +1 -1
- package/dist/waveform/full-waveform.d.ts +1 -2
- package/dist/waveform/full-waveform.d.ts.map +1 -1
- package/dist/waveform/full-waveform.js +1 -2
- package/dist/waveform/full-waveform.js.map +1 -1
- package/dist/waveform/index.js.map +1 -1
- package/dist/waveform/live-waveform.d.ts +2 -2
- package/dist/waveform/live-waveform.js +2 -2
- package/dist/waveform/live-waveform.js.map +1 -1
- package/dist/waveform/shared.d.ts +10 -8
- package/dist/waveform/shared.d.ts.map +1 -1
- package/dist/waveform/shared.js +14 -15
- package/dist/waveform/shared.js.map +1 -1
- package/package.json +7 -6
- package/registry.json +28 -28
- package/src/index.ts +2 -2
- package/src/kit.ts +22 -22
- package/src/nodes.ts +19 -19
- package/src/waveform/envelope.ts +176 -143
- package/src/waveform/full-waveform.ts +217 -218
- package/src/waveform/index.ts +30 -30
- package/src/waveform/live-waveform.ts +221 -221
- package/src/waveform/shared.ts +197 -194
- package/dist/browser/chunks/chunk-B3JXGNP6.js +0 -2
- package/dist/browser/chunks/chunk-B3JXGNP6.js.map +0 -7
|
@@ -1,218 +1,217 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Node2D,
|
|
3
|
-
node,
|
|
4
|
-
command,
|
|
5
|
-
easeInOut,
|
|
6
|
-
fillOps,
|
|
7
|
-
property,
|
|
8
|
-
type AssetScope,
|
|
9
|
-
type CommandArgs,
|
|
10
|
-
type Fill,
|
|
11
|
-
type FillResolved,
|
|
12
|
-
type Node2DProps,
|
|
13
|
-
type RenderContext2D,
|
|
14
|
-
} from "@motionscript/sdk"
|
|
15
|
-
|
|
16
|
-
import { declarePaints } from "@motionscript/sdk/component"
|
|
17
|
-
import type { Seekable } from "@motionscript/sdk/component"
|
|
18
|
-
import { EMPTY_ENVELOPE, sampleEnvelope, type AudioEnvelope } from "./envelope"
|
|
19
|
-
import {
|
|
20
|
-
clamp01,
|
|
21
|
-
groupByPaint,
|
|
22
|
-
layOutBars,
|
|
23
|
-
paintBars,
|
|
24
|
-
voiceColor,
|
|
25
|
-
type WaveformAlignment,
|
|
26
|
-
} from "./shared"
|
|
27
|
-
|
|
28
|
-
export interface FullWaveformProps extends Node2DProps {
|
|
29
|
-
/** The baked recording. See {@link AudioEnvelope} for why it is baked. */
|
|
30
|
-
envelope: AudioEnvelope
|
|
31
|
-
/** How many columns the whole file is drawn as. */
|
|
32
|
-
bars: number
|
|
33
|
-
/** Space between bars, as a fraction of the pitch. See {@link layOutBars}. */
|
|
34
|
-
gap: number
|
|
35
|
-
/** Corner radius of a bar, capped at half its width. */
|
|
36
|
-
radius: number
|
|
37
|
-
/** How much of the file reads as played, `0`–`1`. Tweenable. */
|
|
38
|
-
progress: number
|
|
39
|
-
/** Drive {@link progress} from the node's own clock instead of the prop. */
|
|
40
|
-
follow: boolean
|
|
41
|
-
/** Multiplies every magnitude — a quiet track pulled up to fill its box. */
|
|
42
|
-
gain: number
|
|
43
|
-
/** How much of the box a silent bar still occupies, `0`–`1`. */
|
|
44
|
-
floor: number
|
|
45
|
-
align: WaveformAlignment
|
|
46
|
-
/** Colour each voice's turns rather than splitting on played / not played. */
|
|
47
|
-
byVoice: boolean
|
|
48
|
-
/** A colour per voice index. Short or empty falls back to the palette. */
|
|
49
|
-
voiceColors: string[]
|
|
50
|
-
/** The bars ahead of the playhead. */
|
|
51
|
-
fill: Fill
|
|
52
|
-
/** …and the bars behind it. */
|
|
53
|
-
playedFill: Fill
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* A **waveform overview**: the whole recording's shape, drawn at once.
|
|
58
|
-
*
|
|
59
|
-
* The picture every audio editor opens with, and the one a podcast clip puts
|
|
60
|
-
* under its caption — a static silhouette of the file, with a played portion
|
|
61
|
-
* that advances. It answers "how long is this and where are the loud parts",
|
|
62
|
-
* which is a question about the *file*, not about the moment; its sibling
|
|
63
|
-
* {@link LiveWaveform} answers the other one.
|
|
64
|
-
*
|
|
65
|
-
* ## Progress is authored, not assumed
|
|
66
|
-
*
|
|
67
|
-
* {@link follow} is off by default, and that default is the considered one. A
|
|
68
|
-
* scene has no idea where the recording it is drawing sits on the video's audio
|
|
69
|
-
* lane — a clip is placed, trimmed and sped up out there, and none of that is
|
|
70
|
-
* visible from in here. So the honest default is that the fill is *animation*:
|
|
71
|
-
* the author sweeps it with a command, the same as any other tween, and it lands
|
|
72
|
-
* wherever they put it. `follow` is the shortcut for the common arrangement
|
|
73
|
-
* where the node appears exactly as the track starts, and it says so by being a
|
|
74
|
-
* switch someone has to turn on rather than a behaviour that quietly disagrees
|
|
75
|
-
* with the mix.
|
|
76
|
-
*
|
|
77
|
-
* ## Voices instead of progress
|
|
78
|
-
*
|
|
79
|
-
* With {@link byVoice} on, the played/ahead split is replaced by one colour per
|
|
80
|
-
* speaking voice
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
@property({ default:
|
|
104
|
-
@property({ default:
|
|
105
|
-
@property({ default:
|
|
106
|
-
@property({ default:
|
|
107
|
-
@property({ default:
|
|
108
|
-
@property({ default:
|
|
109
|
-
@property({ default:
|
|
110
|
-
@property({ default:
|
|
111
|
-
@property({ default:
|
|
112
|
-
@property({ default:
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (key === "
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Node2D,
|
|
3
|
+
node,
|
|
4
|
+
command,
|
|
5
|
+
easeInOut,
|
|
6
|
+
fillOps,
|
|
7
|
+
property,
|
|
8
|
+
type AssetScope,
|
|
9
|
+
type CommandArgs,
|
|
10
|
+
type Fill,
|
|
11
|
+
type FillResolved,
|
|
12
|
+
type Node2DProps,
|
|
13
|
+
type RenderContext2D,
|
|
14
|
+
} from "@motionscript/sdk"
|
|
15
|
+
|
|
16
|
+
import { declarePaints } from "@motionscript/sdk/component"
|
|
17
|
+
import type { Seekable } from "@motionscript/sdk/component"
|
|
18
|
+
import { EMPTY_ENVELOPE, sampleEnvelope, type AudioEnvelope } from "./envelope"
|
|
19
|
+
import {
|
|
20
|
+
clamp01,
|
|
21
|
+
groupByPaint,
|
|
22
|
+
layOutBars,
|
|
23
|
+
paintBars,
|
|
24
|
+
voiceColor,
|
|
25
|
+
type WaveformAlignment,
|
|
26
|
+
} from "./shared"
|
|
27
|
+
|
|
28
|
+
export interface FullWaveformProps extends Node2DProps {
|
|
29
|
+
/** The baked recording. See {@link AudioEnvelope} for why it is baked. */
|
|
30
|
+
envelope: AudioEnvelope
|
|
31
|
+
/** How many columns the whole file is drawn as. */
|
|
32
|
+
bars: number
|
|
33
|
+
/** Space between bars, as a fraction of the pitch. See {@link layOutBars}. */
|
|
34
|
+
gap: number
|
|
35
|
+
/** Corner radius of a bar, capped at half its width. */
|
|
36
|
+
radius: number
|
|
37
|
+
/** How much of the file reads as played, `0`–`1`. Tweenable. */
|
|
38
|
+
progress: number
|
|
39
|
+
/** Drive {@link progress} from the node's own clock instead of the prop. */
|
|
40
|
+
follow: boolean
|
|
41
|
+
/** Multiplies every magnitude — a quiet track pulled up to fill its box. */
|
|
42
|
+
gain: number
|
|
43
|
+
/** How much of the box a silent bar still occupies, `0`–`1`. */
|
|
44
|
+
floor: number
|
|
45
|
+
align: WaveformAlignment
|
|
46
|
+
/** Colour each voice's turns rather than splitting on played / not played. */
|
|
47
|
+
byVoice: boolean
|
|
48
|
+
/** A colour per voice index. Short or empty falls back to the palette. */
|
|
49
|
+
voiceColors: string[]
|
|
50
|
+
/** The bars ahead of the playhead. */
|
|
51
|
+
fill: Fill
|
|
52
|
+
/** …and the bars behind it. */
|
|
53
|
+
playedFill: Fill
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A **waveform overview**: the whole recording's shape, drawn at once.
|
|
58
|
+
*
|
|
59
|
+
* The picture every audio editor opens with, and the one a podcast clip puts
|
|
60
|
+
* under its caption — a static silhouette of the file, with a played portion
|
|
61
|
+
* that advances. It answers "how long is this and where are the loud parts",
|
|
62
|
+
* which is a question about the *file*, not about the moment; its sibling
|
|
63
|
+
* {@link LiveWaveform} answers the other one.
|
|
64
|
+
*
|
|
65
|
+
* ## Progress is authored, not assumed
|
|
66
|
+
*
|
|
67
|
+
* {@link follow} is off by default, and that default is the considered one. A
|
|
68
|
+
* scene has no idea where the recording it is drawing sits on the video's audio
|
|
69
|
+
* lane — a clip is placed, trimmed and sped up out there, and none of that is
|
|
70
|
+
* visible from in here. So the honest default is that the fill is *animation*:
|
|
71
|
+
* the author sweeps it with a command, the same as any other tween, and it lands
|
|
72
|
+
* wherever they put it. `follow` is the shortcut for the common arrangement
|
|
73
|
+
* where the node appears exactly as the track starts, and it says so by being a
|
|
74
|
+
* switch someone has to turn on rather than a behaviour that quietly disagrees
|
|
75
|
+
* with the mix.
|
|
76
|
+
*
|
|
77
|
+
* ## Voices instead of progress
|
|
78
|
+
*
|
|
79
|
+
* With {@link byVoice} on, the played/ahead split is replaced by one colour per
|
|
80
|
+
* speaking voice, at a size you can read. For a two-hander it is a map of the conversation: who has the
|
|
81
|
+
* floor, where the turns are, how long each one ran. It replaces the progress
|
|
82
|
+
* colours rather than combining with them, because a bar cannot mean two things
|
|
83
|
+
* at once and "played, and also Grace" is a legend nobody can hold in their
|
|
84
|
+
* head.
|
|
85
|
+
*/
|
|
86
|
+
@node({
|
|
87
|
+
key: "fullWaveform",
|
|
88
|
+
parentKey: "node",
|
|
89
|
+
forkable: true,
|
|
90
|
+
layout: {
|
|
91
|
+
children: "freeform",
|
|
92
|
+
defaultWidthMode: "fixed",
|
|
93
|
+
defaultHeightMode: "fixed",
|
|
94
|
+
acceptsChildren: true,
|
|
95
|
+
},
|
|
96
|
+
seed: {
|
|
97
|
+
width: 900,
|
|
98
|
+
height: 160,
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
export class FullWaveform extends Node2D<FullWaveformProps> {
|
|
102
|
+
@property({ default: EMPTY_ENVELOPE }) declare envelope: AudioEnvelope
|
|
103
|
+
@property({ default: 120 }) declare bars: number
|
|
104
|
+
@property({ default: 0.3 }) declare gap: number
|
|
105
|
+
@property({ default: 2 }) declare radius: number
|
|
106
|
+
@property({ default: 0 }) declare progress: number
|
|
107
|
+
@property({ default: false }) declare follow: boolean
|
|
108
|
+
@property({ default: 1 }) declare gain: number
|
|
109
|
+
@property({ default: 0.015 }) declare floor: number
|
|
110
|
+
@property({ default: "center" }) declare align: WaveformAlignment
|
|
111
|
+
@property({ default: false }) declare byVoice: boolean
|
|
112
|
+
@property({ default: [] }) declare voiceColors: string[]
|
|
113
|
+
|
|
114
|
+
@property({
|
|
115
|
+
default: "#5b5b7a",
|
|
116
|
+
mapper: fillOps.resolve,
|
|
117
|
+
tween: fillOps.lerp,
|
|
118
|
+
})
|
|
119
|
+
declare fill: Fill
|
|
120
|
+
|
|
121
|
+
@property({
|
|
122
|
+
default: "#6366f1",
|
|
123
|
+
mapper: fillOps.resolve,
|
|
124
|
+
tween: fillOps.lerp,
|
|
125
|
+
})
|
|
126
|
+
declare playedFill: Fill
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Fill the waveform in, left to right — the node's one command, since
|
|
130
|
+
* everything else about it is expressible as an ordinary `to`.
|
|
131
|
+
*/
|
|
132
|
+
@command()
|
|
133
|
+
sweep(args: CommandArgs<Record<string, never>> & { duration: number }): Seekable {
|
|
134
|
+
return this.to({
|
|
135
|
+
data: { progress: 1 } as Partial<FullWaveformProps>,
|
|
136
|
+
duration: args.duration,
|
|
137
|
+
easing: args.easing ?? easeInOut(),
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* This node extends `Node2D` rather than `ShapeNode`, so nothing declares the
|
|
143
|
+
* paint props it carries — see {@link declarePaints}. `playedFill` is named
|
|
144
|
+
* past the conventional slots, so it is passed explicitly.
|
|
145
|
+
*/
|
|
146
|
+
override declareAssets(assets: AssetScope): void {
|
|
147
|
+
super.declareAssets(assets)
|
|
148
|
+
declarePaints(this, assets, { fills: [this.playedFill as FillResolved[]] })
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Where the fill has reached, from whichever source is in charge. */
|
|
152
|
+
private get played(): number {
|
|
153
|
+
if (!this.follow) return clamp01(this.progress)
|
|
154
|
+
const length = this.envelope.duration
|
|
155
|
+
if (length <= 0) return 0
|
|
156
|
+
return clamp01(this.time.elapsed / length)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
protected renderSelf(ctx: RenderContext2D): void {
|
|
160
|
+
const rect = this.layoutBounds
|
|
161
|
+
const width = rect?.width ?? 0
|
|
162
|
+
const height = rect?.height ?? 0
|
|
163
|
+
if (width <= 0 || height <= 0) return
|
|
164
|
+
|
|
165
|
+
const count = Math.max(1, Math.round(this.bars))
|
|
166
|
+
const sampled = sampleEnvelope(
|
|
167
|
+
this.envelope,
|
|
168
|
+
0,
|
|
169
|
+
this.envelope.duration,
|
|
170
|
+
count
|
|
171
|
+
)
|
|
172
|
+
const boxes = layOutBars(sampled, {
|
|
173
|
+
width,
|
|
174
|
+
height,
|
|
175
|
+
gap: this.gap,
|
|
176
|
+
align: this.align,
|
|
177
|
+
gain: this.gain,
|
|
178
|
+
floor: this.floor,
|
|
179
|
+
})
|
|
180
|
+
if (boxes.length === 0) return
|
|
181
|
+
|
|
182
|
+
// One draw per colour rather than per bar — see {@link paintBars}. The key
|
|
183
|
+
// is a string because it has to be comparable; the paint it stands for is
|
|
184
|
+
// resolved after the grouping.
|
|
185
|
+
const edge = this.played * boxes.length
|
|
186
|
+
const groups = groupByPaint(boxes, (i) =>
|
|
187
|
+
this.byVoice
|
|
188
|
+
? `voice:${sampled[i].speaker}`
|
|
189
|
+
: i < edge
|
|
190
|
+
? "played"
|
|
191
|
+
: "ahead"
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
for (const [key, run] of groups) {
|
|
195
|
+
const graphics = paintBars(run, this.paintFor(key), this.radius)
|
|
196
|
+
if (graphics) ctx.draw(graphics)
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The paint a group takes.
|
|
202
|
+
*
|
|
203
|
+
* A voice's colour is a **colour string**, never one of the node's two fill
|
|
204
|
+
* props, and that is deliberate: a voice is identified by hue, so a gradient
|
|
205
|
+
* or an image there would defeat the only thing the colour is for. It also
|
|
206
|
+
* means these paints declare no assets, which is why {@link declareAssets}
|
|
207
|
+
* only has to account for the two real fill props.
|
|
208
|
+
*/
|
|
209
|
+
private paintFor(key: string): Fill {
|
|
210
|
+
if (key === "played") return this.playedFill
|
|
211
|
+
if (key === "ahead") return this.fill
|
|
212
|
+
|
|
213
|
+
const voice = Number(key.slice("voice:".length))
|
|
214
|
+
if (!Number.isFinite(voice) || voice < 0) return this.fill
|
|
215
|
+
return this.voiceColors[voice] ?? voiceColor(voice)
|
|
216
|
+
}
|
|
217
|
+
}
|
package/src/waveform/index.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The waveform family: one subject, two questions.
|
|
3
|
-
*
|
|
4
|
-
* - {@link FullWaveform} draws the **file** — the whole recording's silhouette,
|
|
5
|
-
* with a played portion that advances. "How long is this, and where are the
|
|
6
|
-
* loud parts."
|
|
7
|
-
* - {@link LiveWaveform} draws the **moment** — bars moving with playback, the
|
|
8
|
-
* visualiser a podcast clip puts beside the artwork. "Is anything happening
|
|
9
|
-
* right now, and whose voice is it."
|
|
10
|
-
*
|
|
11
|
-
* Both read the same baked {@link AudioEnvelope}, which is why they cannot
|
|
12
|
-
* disagree about a recording, and why neither listens to anything — see that
|
|
13
|
-
* module for why a scene that has to export cannot use a live analyser.
|
|
14
|
-
*/
|
|
15
|
-
export { FullWaveform } from "./full-waveform"
|
|
16
|
-
export type { FullWaveformProps } from "./full-waveform"
|
|
17
|
-
export { LiveWaveform } from "./live-waveform"
|
|
18
|
-
export type { LiveWaveformProps } from "./live-waveform"
|
|
19
|
-
export { EMPTY_ENVELOPE, forSpeaker, sampleEnvelope } from "./envelope"
|
|
20
|
-
export type { AudioEnvelope, EnvelopeBar } from "./envelope"
|
|
21
|
-
export {
|
|
22
|
-
VOICE_PALETTE,
|
|
23
|
-
WAVEFORM_ALIGNMENTS,
|
|
24
|
-
WAVEFORM_STYLES,
|
|
25
|
-
groupByPaint,
|
|
26
|
-
layOutBars,
|
|
27
|
-
paintBars,
|
|
28
|
-
voiceColor,
|
|
29
|
-
} from "./shared"
|
|
30
|
-
export type { BarBox, WaveformAlignment, WaveformStyle } from "./shared"
|
|
1
|
+
/**
|
|
2
|
+
* The waveform family: one subject, two questions.
|
|
3
|
+
*
|
|
4
|
+
* - {@link FullWaveform} draws the **file** — the whole recording's silhouette,
|
|
5
|
+
* with a played portion that advances. "How long is this, and where are the
|
|
6
|
+
* loud parts."
|
|
7
|
+
* - {@link LiveWaveform} draws the **moment** — bars moving with playback, the
|
|
8
|
+
* visualiser a podcast clip puts beside the artwork. "Is anything happening
|
|
9
|
+
* right now, and whose voice is it."
|
|
10
|
+
*
|
|
11
|
+
* Both read the same baked {@link AudioEnvelope}, which is why they cannot
|
|
12
|
+
* disagree about a recording, and why neither listens to anything — see that
|
|
13
|
+
* module for why a scene that has to export cannot use a live analyser.
|
|
14
|
+
*/
|
|
15
|
+
export { FullWaveform } from "./full-waveform"
|
|
16
|
+
export type { FullWaveformProps } from "./full-waveform"
|
|
17
|
+
export { LiveWaveform } from "./live-waveform"
|
|
18
|
+
export type { LiveWaveformProps } from "./live-waveform"
|
|
19
|
+
export { EMPTY_ENVELOPE, forSpeaker, sampleEnvelope } from "./envelope"
|
|
20
|
+
export type { AudioEnvelope, EnvelopeBar } from "./envelope"
|
|
21
|
+
export {
|
|
22
|
+
VOICE_PALETTE,
|
|
23
|
+
WAVEFORM_ALIGNMENTS,
|
|
24
|
+
WAVEFORM_STYLES,
|
|
25
|
+
groupByPaint,
|
|
26
|
+
layOutBars,
|
|
27
|
+
paintBars,
|
|
28
|
+
voiceColor,
|
|
29
|
+
} from "./shared"
|
|
30
|
+
export type { BarBox, WaveformAlignment, WaveformStyle } from "./shared"
|