taglib-wasm 1.0.4 → 1.0.6
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/README.md +38 -443
- package/dist/index.browser.d.ts +2 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +49 -101
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/simple.browser.js +47 -101
- package/dist/src/errors/base.d.ts +1 -1
- package/dist/src/errors/base.d.ts.map +1 -1
- package/dist/src/errors/base.js +2 -1
- package/dist/src/folder-api/folder-operations.d.ts +2 -1
- package/dist/src/folder-api/folder-operations.d.ts.map +1 -1
- package/dist/src/folder-api/types.d.ts.map +1 -1
- package/dist/src/folder-api/types.js +4 -1
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
- package/dist/src/runtime/wasi-adapter/file-handle.js +3 -1
- package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +1 -1
- package/dist/src/runtime/wasi-adapter/wasm-io.js +9 -0
- package/dist/src/runtime/wasi-host.d.ts.map +1 -1
- package/dist/src/runtime/wasi-host.js +5 -0
- package/dist/src/simple/batch-operations.d.ts +4 -4
- package/dist/src/simple/batch-operations.d.ts.map +1 -1
- package/dist/src/simple/batch-operations.js +4 -1
- package/dist/src/simple/picture-operations.d.ts.map +1 -1
- package/dist/src/simple/picture-operations.js +6 -50
- package/dist/src/simple/tag-operations.d.ts.map +1 -1
- package/dist/src/simple/tag-operations.js +12 -65
- package/dist/src/simple/with-audio-file.d.ts +5 -0
- package/dist/src/simple/with-audio-file.d.ts.map +1 -0
- package/dist/src/simple/with-audio-file.js +32 -0
- package/dist/src/taglib/audio-file-base.d.ts +3 -3
- package/dist/src/taglib/audio-file-base.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-impl.d.ts +2 -2
- package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
- package/dist/src/taglib/taglib-class.d.ts +3 -2
- package/dist/src/taglib/taglib-class.d.ts.map +1 -1
- package/dist/src/taglib/taglib-class.js +9 -5
- package/dist/src/types/audio-formats.d.ts +12 -3
- package/dist/src/types/audio-formats.d.ts.map +1 -1
- package/dist/src/types/audio-formats.js +6 -0
- package/dist/src/types/format-property-keys.d.ts +1 -1
- package/dist/src/types/format-property-keys.d.ts.map +1 -1
- package/dist/taglib-web.wasm +0 -0
- package/dist/taglib-wrapper.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,443 +1,38 @@
|
|
|
1
|
-
# TagLib
|
|
2
|
-
|
|
3
|
-
[.
|
|
59
|
-
|
|
60
|
-
### Bun
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
bun add taglib-wasm
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Electron (Node.js)
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm install taglib-wasm
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
taglib-wasm works in Electron's main process (which is Node.js). For the
|
|
73
|
-
renderer process, expose metadata through IPC:
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
// Main process
|
|
77
|
-
import { TagLib } from "taglib-wasm";
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
See [Platform Examples](docs/guide/platform-examples.md#electron) for full IPC
|
|
81
|
-
setup.
|
|
82
|
-
|
|
83
|
-
### Deno Compiled Binaries (Offline Support)
|
|
84
|
-
|
|
85
|
-
For Deno compiled binaries that need to work offline, you can embed the WASM
|
|
86
|
-
file:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
// 1. Prepare your build by copying the WASM file
|
|
90
|
-
import { prepareWasmForEmbedding } from "@charlesw/taglib-wasm";
|
|
91
|
-
await prepareWasmForEmbedding("./taglib.wasm");
|
|
92
|
-
|
|
93
|
-
// 2. In your application, use the helper for automatic handling
|
|
94
|
-
import { initializeForDenoCompile } from "@charlesw/taglib-wasm";
|
|
95
|
-
const taglib = await initializeForDenoCompile();
|
|
96
|
-
|
|
97
|
-
// 3. Compile with the embedded WASM
|
|
98
|
-
// deno compile --allow-read --include taglib.wasm myapp.ts
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
See the
|
|
102
|
-
[complete Deno compile guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/deno-compile.html)
|
|
103
|
-
for more options including CDN loading.
|
|
104
|
-
|
|
105
|
-
For manual control:
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
// Load embedded WASM in compiled binaries
|
|
109
|
-
const wasmBinary = await Deno.readFile(
|
|
110
|
-
new URL("./taglib.wasm", import.meta.url),
|
|
111
|
-
);
|
|
112
|
-
const taglib = await TagLib.initialize({ wasmBinary });
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Quick Start
|
|
116
|
-
|
|
117
|
-
> **Import paths:** Deno uses `@charlesw/taglib-wasm`, npm uses `taglib-wasm`.
|
|
118
|
-
> Examples below use npm paths — substitute accordingly.
|
|
119
|
-
|
|
120
|
-
### Simple API
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
import { applyTags, applyTagsToFile, readTags } from "taglib-wasm/simple";
|
|
124
|
-
|
|
125
|
-
// Read tags (string fields are arrays to support multi-value metadata)
|
|
126
|
-
const tags = await readTags("song.mp3");
|
|
127
|
-
console.log(tags.title?.[0], tags.artist?.[0], tags.album?.[0]);
|
|
128
|
-
|
|
129
|
-
// Apply tags and get modified buffer (in-memory)
|
|
130
|
-
const modifiedBuffer = await applyTags("song.mp3", {
|
|
131
|
-
title: "New Title",
|
|
132
|
-
artist: "New Artist",
|
|
133
|
-
album: "New Album",
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Or update tags on disk (requires file path)
|
|
137
|
-
await applyTagsToFile("song.mp3", {
|
|
138
|
-
title: "New Title",
|
|
139
|
-
artist: "New Artist",
|
|
140
|
-
});
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### High-Performance Batch Processing
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
import { readMetadataBatch, readTagsBatch } from "taglib-wasm/simple";
|
|
147
|
-
|
|
148
|
-
// Process multiple files in parallel
|
|
149
|
-
const files = ["track01.mp3", "track02.mp3", /* ... */ "track20.mp3"];
|
|
150
|
-
|
|
151
|
-
// Read just tags (18x faster than sequential)
|
|
152
|
-
const tags = await readTagsBatch(files, { concurrency: 8 });
|
|
153
|
-
|
|
154
|
-
// Read complete metadata including cover art detection (15x faster)
|
|
155
|
-
const metadata = await readMetadataBatch(files, { concurrency: 8 });
|
|
156
|
-
|
|
157
|
-
// Real-world performance:
|
|
158
|
-
// Sequential: ~100 seconds for 20 files
|
|
159
|
-
// Batch: ~5 seconds for 20 files (20x speedup!)
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Full API
|
|
163
|
-
|
|
164
|
-
The Full API might be a better choice for apps and utilities focused on advanced
|
|
165
|
-
metadata management.
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
import { TagLib } from "taglib-wasm";
|
|
169
|
-
|
|
170
|
-
// Initialize taglib-wasm
|
|
171
|
-
const taglib = await TagLib.initialize();
|
|
172
|
-
|
|
173
|
-
// Load audio file (automatically cleaned up when scope exits)
|
|
174
|
-
using file = await taglib.open("song.mp3");
|
|
175
|
-
|
|
176
|
-
// Read and update metadata
|
|
177
|
-
const tag = file.tag();
|
|
178
|
-
tag.setTitle("New Title");
|
|
179
|
-
tag.setArtist("New Artist");
|
|
180
|
-
|
|
181
|
-
// Save changes
|
|
182
|
-
file.save();
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Batch Folder Operations
|
|
186
|
-
|
|
187
|
-
Process entire music collections efficiently:
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
import { findDuplicates, scanFolder } from "taglib-wasm";
|
|
191
|
-
|
|
192
|
-
// Scan a music library
|
|
193
|
-
const result = await scanFolder("/path/to/music", {
|
|
194
|
-
recursive: true,
|
|
195
|
-
onProgress: (processed, total, file) => {
|
|
196
|
-
console.log(`Processing ${processed}/${total}: ${file}`);
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
console.log(`Found ${result.items.length} audio files`);
|
|
201
|
-
console.log(
|
|
202
|
-
`Successfully processed ${
|
|
203
|
-
result.items.filter((i) => i.status === "ok").length
|
|
204
|
-
} files`,
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
// Process results
|
|
208
|
-
for (const file of result.items) {
|
|
209
|
-
console.log(
|
|
210
|
-
`${file.path}: ${file.tags.artist?.[0]} - ${file.tags.title?.[0]}`,
|
|
211
|
-
);
|
|
212
|
-
console.log(`Duration: ${file.properties?.duration}s`);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Find duplicates
|
|
216
|
-
const duplicates = await findDuplicates("/path/to/music", {
|
|
217
|
-
criteria: ["artist", "title"],
|
|
218
|
-
});
|
|
219
|
-
console.log(`Found ${duplicates.size} groups of duplicates`);
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Working with Cover Art
|
|
223
|
-
|
|
224
|
-
```typescript
|
|
225
|
-
import { applyCoverArt, readCoverArt } from "taglib-wasm/simple";
|
|
226
|
-
|
|
227
|
-
// Extract cover art
|
|
228
|
-
const coverData = await readCoverArt("song.mp3");
|
|
229
|
-
if (coverData) {
|
|
230
|
-
await Deno.writeFile("cover.jpg", coverData);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Set new cover art
|
|
234
|
-
const imageData = await Deno.readFile("new-cover.jpg");
|
|
235
|
-
const modifiedBuffer = await applyCoverArt("song.mp3", imageData, "image/jpeg");
|
|
236
|
-
// Save modifiedBuffer to file if needed
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Working with Ratings
|
|
240
|
-
|
|
241
|
-
```typescript
|
|
242
|
-
import { RatingUtils, TagLib } from "taglib-wasm";
|
|
243
|
-
|
|
244
|
-
const taglib = await TagLib.initialize();
|
|
245
|
-
using file = await taglib.open("song.mp3");
|
|
246
|
-
|
|
247
|
-
// Read rating (normalized 0.0-1.0)
|
|
248
|
-
const rating = file.getRating();
|
|
249
|
-
if (rating !== undefined) {
|
|
250
|
-
console.log(`Rating: ${RatingUtils.toStars(rating)} stars`);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Set rating (4 out of 5 stars)
|
|
254
|
-
file.setRating(0.8);
|
|
255
|
-
file.save();
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
See the [Track Ratings Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
|
|
259
|
-
for RatingUtils API and cross-format conversion details.
|
|
260
|
-
|
|
261
|
-
### Container Format and Codec Detection
|
|
262
|
-
|
|
263
|
-
```typescript
|
|
264
|
-
import { readProperties } from "taglib-wasm/simple";
|
|
265
|
-
|
|
266
|
-
// Get detailed audio properties including container and codec info
|
|
267
|
-
const props = await readProperties("song.m4a");
|
|
268
|
-
|
|
269
|
-
console.log(props.containerFormat); // "MP4" (container format)
|
|
270
|
-
console.log(props.codec); // "AAC" or "ALAC" (compressed media format)
|
|
271
|
-
console.log(props.isLossless); // false for AAC, true for ALAC
|
|
272
|
-
console.log(props.bitsPerSample); // 16 for most formats
|
|
273
|
-
console.log(props.bitrate); // 256 (kbps)
|
|
274
|
-
console.log(props.sampleRate); // 44100 (Hz)
|
|
275
|
-
console.log(props.duration); // 180 (duration in seconds)
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
Container format vs Codec:
|
|
279
|
-
|
|
280
|
-
- **Container format** – How audio data and metadata are packaged (e.g., MP4, OGG)
|
|
281
|
-
- **Codec** – How audio is compressed/encoded (e.g., AAC, Vorbis)
|
|
282
|
-
|
|
283
|
-
Supported formats:
|
|
284
|
-
|
|
285
|
-
- **MP4 container** (.mp4, .m4a) – Can contain AAC (lossy) or ALAC (lossless)
|
|
286
|
-
- **OGG container** (.ogg) – Can contain Vorbis, Opus, FLAC, or Speex
|
|
287
|
-
- **MP3** – Both container and codec (lossy)
|
|
288
|
-
- **FLAC** – Both container and codec (lossless)
|
|
289
|
-
- **WAV** – Container for PCM (uncompressed) audio
|
|
290
|
-
- **AIFF** – Container for PCM (uncompressed) audio
|
|
291
|
-
|
|
292
|
-
## Documentation
|
|
293
|
-
|
|
294
|
-
**[View Full Documentation](https://charleswiltgen.github.io/TagLib-Wasm/)**
|
|
295
|
-
|
|
296
|
-
### Getting Started
|
|
297
|
-
|
|
298
|
-
- [Installation Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/installation.html)
|
|
299
|
-
- [Quick Start Tutorial](https://charleswiltgen.github.io/TagLib-Wasm/guide/quick-start.html)
|
|
300
|
-
- [All Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/examples.html)
|
|
301
|
-
|
|
302
|
-
### Guides
|
|
303
|
-
|
|
304
|
-
- [API Reference](https://charleswiltgen.github.io/TagLib-Wasm/api/)
|
|
305
|
-
- [Performance Guide](https://charleswiltgen.github.io/TagLib-Wasm/concepts/performance.html)
|
|
306
|
-
- [Album Processing Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/album-processing.html)
|
|
307
|
-
- [Platform Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/platform-examples.html)
|
|
308
|
-
- [Working with Cover Art](https://charleswiltgen.github.io/TagLib-Wasm/guide/cover-art.html)
|
|
309
|
-
- [Track Ratings](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
|
|
310
|
-
- [Cloudflare Workers](https://charleswiltgen.github.io/TagLib-Wasm/advanced/cloudflare-workers.html)
|
|
311
|
-
- [Error Handling](https://charleswiltgen.github.io/TagLib-Wasm/concepts/error-handling.html)
|
|
312
|
-
- [Contributing](CONTRIBUTING.md)
|
|
313
|
-
- [AI Agent Documentation](AGENTS.md)
|
|
314
|
-
|
|
315
|
-
## Supported Formats
|
|
316
|
-
|
|
317
|
-
`taglib-wasm` is designed to support all formats supported by TagLib:
|
|
318
|
-
|
|
319
|
-
- **.mp3** – ID3v2 and ID3v1 tags
|
|
320
|
-
- **.m4a/.mp4** – MPEG-4/AAC metadata for AAC and Apple Lossless audio
|
|
321
|
-
- **.flac** – Vorbis comments and audio properties
|
|
322
|
-
- **.ogg** – Ogg Vorbis format with full metadata support
|
|
323
|
-
- **.wav** – INFO chunk metadata
|
|
324
|
-
- **Additional formats** – Opus, APE, MPC, WavPack, TrueAudio, AIFF, WMA, and
|
|
325
|
-
more
|
|
326
|
-
|
|
327
|
-
## Performance and Best Practices
|
|
328
|
-
|
|
329
|
-
### Batch Processing for Multiple Files
|
|
330
|
-
|
|
331
|
-
When processing multiple audio files, use the optimized batch APIs for better performance:
|
|
332
|
-
|
|
333
|
-
```typescript
|
|
334
|
-
import { readMetadataBatch, readTagsBatch } from "taglib-wasm/simple";
|
|
335
|
-
|
|
336
|
-
// Processing files one by one (can take 90+ seconds for 19 files)
|
|
337
|
-
for (const file of files) {
|
|
338
|
-
const tags = await readTags(file); // Re-initializes for each file
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Batch processing (10-20x faster)
|
|
342
|
-
const result = await readTagsBatch(files, {
|
|
343
|
-
concurrency: 8, // Process 8 files in parallel
|
|
344
|
-
onProgress: (processed, total) => {
|
|
345
|
-
console.log(`${processed}/${total} files processed`);
|
|
346
|
-
},
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
// Read complete metadata in one batch
|
|
350
|
-
const metadata = await readMetadataBatch(files, { concurrency: 8 });
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
**Performance comparison for 19 audio files:**
|
|
354
|
-
|
|
355
|
-
- Sequential: ~90 seconds (4.7s per file)
|
|
356
|
-
- Batch (concurrency=4): ~8 seconds (11x faster)
|
|
357
|
-
- Batch (concurrency=8): ~5 seconds (18x faster)
|
|
358
|
-
|
|
359
|
-
### Smart Partial Loading
|
|
360
|
-
|
|
361
|
-
For large audio files (>50MB), enable partial loading to reduce memory usage:
|
|
362
|
-
|
|
363
|
-
```typescript
|
|
364
|
-
// Enable partial loading for large files
|
|
365
|
-
using file = await taglib.open("large-concert.flac", {
|
|
366
|
-
partial: true,
|
|
367
|
-
maxHeaderSize: 2 * 1024 * 1024, // 2MB header
|
|
368
|
-
maxFooterSize: 256 * 1024, // 256KB footer
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
// Read operations work normally
|
|
372
|
-
const tags = file.tag();
|
|
373
|
-
console.log(tags.title, tags.artist);
|
|
374
|
-
|
|
375
|
-
// Smart save - automatically loads full file when needed
|
|
376
|
-
await file.saveToFile(); // Full file loaded only here
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
**Performance gains:**
|
|
380
|
-
|
|
381
|
-
- **500MB file**: ~450x less memory usage (1.1MB vs 500MB)
|
|
382
|
-
- **Initial load**: 50x faster (50ms vs 2500ms)
|
|
383
|
-
- **Memory peak**: 3.3MB instead of 1.5GB
|
|
384
|
-
|
|
385
|
-
### Runtime Optimization Tiers
|
|
386
|
-
|
|
387
|
-
taglib-wasm auto-selects the fastest available backend — no configuration needed:
|
|
388
|
-
|
|
389
|
-
| Environment | Backend | How it works | Performance |
|
|
390
|
-
| ------------------------ | ----------------- | ------------------------------------------------------ | ----------- |
|
|
391
|
-
| **Deno / Node.js / Bun** | WASI (auto) | Seek-based filesystem I/O; reads only headers and tags | Fastest |
|
|
392
|
-
| **Browsers / Workers** | Emscripten (auto) | Entire file loaded into memory as buffer | Baseline |
|
|
393
|
-
|
|
394
|
-
On Deno, Node.js, and Bun you get WASI automatically — nothing to configure.
|
|
395
|
-
|
|
396
|
-
## Runtime Compatibility
|
|
397
|
-
|
|
398
|
-
`taglib-wasm` works across all major JavaScript runtimes:
|
|
399
|
-
|
|
400
|
-
| Runtime | Status | Installation | Notes |
|
|
401
|
-
| ---------------------- | ------- | ------------------------- | -------------------------------------------------------------------------- |
|
|
402
|
-
| **Deno** | Full | `npm:taglib-wasm` | Native TypeScript |
|
|
403
|
-
| **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx |
|
|
404
|
-
| **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only |
|
|
405
|
-
| **Browser** | Full | Via bundler | Full API support |
|
|
406
|
-
| **Cloudflare Workers** | Full | `npm install taglib-wasm` | Same unified API; see [Workers guide](docs/advanced/cloudflare-workers.md) |
|
|
407
|
-
| **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC |
|
|
408
|
-
|
|
409
|
-
## Known Limitations
|
|
410
|
-
|
|
411
|
-
- **Memory Usage (browsers)** – In browser environments, entire files are loaded
|
|
412
|
-
into memory. On Deno/Node.js, WASI reads only headers and tags from disk.
|
|
413
|
-
- **Concurrent Access** – Not thread-safe (JavaScript single-threaded nature
|
|
414
|
-
mitigates this)
|
|
415
|
-
|
|
416
|
-
## Contributing
|
|
417
|
-
|
|
418
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md)
|
|
419
|
-
for details on our code of conduct and the process for submitting pull requests.
|
|
420
|
-
|
|
421
|
-
## License
|
|
422
|
-
|
|
423
|
-
This project uses dual licensing:
|
|
424
|
-
|
|
425
|
-
- **TypeScript/JavaScript code** – MIT License (see [LICENSE](LICENSE))
|
|
426
|
-
- **WebAssembly binary (taglib.wasm)** – LGPL-2.1-or-later (inherited from
|
|
427
|
-
TagLib)
|
|
428
|
-
|
|
429
|
-
The TagLib library is dual-licensed under LGPL/MPL. When compiled to
|
|
430
|
-
WebAssembly, the resulting binary must comply with LGPL requirements. This
|
|
431
|
-
means:
|
|
432
|
-
|
|
433
|
-
- You can use taglib-wasm in commercial projects
|
|
434
|
-
- If you modify the TagLib C++ code, you must share those changes
|
|
435
|
-
- You must provide a way for users to relink with a modified TagLib
|
|
436
|
-
|
|
437
|
-
For details, see [lib/taglib/COPYING.LGPL](lib/taglib/COPYING.LGPL)
|
|
438
|
-
|
|
439
|
-
## Acknowledgments
|
|
440
|
-
|
|
441
|
-
- [TagLib](https://taglib.org/) – Excellent audio metadata library
|
|
442
|
-
- [Emscripten](https://emscripten.org/) – WebAssembly compilation toolchain
|
|
443
|
-
- [WASI](https://wasi.dev/) – WebAssembly System Interface for server-side runtimes
|
|
1
|
+
# TagLib
|
|
2
|
+
|
|
3
|
+
[](../../actions)
|
|
4
|
+
|
|
5
|
+
### TagLib Audio Metadata Library
|
|
6
|
+
|
|
7
|
+
https://taglib.org/
|
|
8
|
+
|
|
9
|
+
TagLib is a library for reading and editing the metadata of several
|
|
10
|
+
popular audio formats. Currently, it supports various metadata containers such
|
|
11
|
+
as [ID3v1][ID3v1], [ID3v2][ID3v2] and [Vorbis][Vorbis] comments for MP3, MP4, AAC,
|
|
12
|
+
[Ogg][Ogg], [Opus][Opus], [FLAC][FLAC], [Speex][Speex], [APE][APE], [MPC][MPC], [WavPack][WavPack],
|
|
13
|
+
[WAV][WAV], [AIFF][AIFF], [TrueAudio][TrueAudio], [Matroska][Matroska], [WebM][WebM], ASF, WMA, DSF, DFF and
|
|
14
|
+
tracker (MOD, XM, S3M, IT) files.
|
|
15
|
+
|
|
16
|
+
TagLib is distributed under the [GNU Lesser General Public License][GNU Lesser General Public License]
|
|
17
|
+
(LGPL) and [Mozilla Public License][Mozilla Public License] (MPL). Essentially that means that
|
|
18
|
+
it may be used in proprietary applications, but if changes are made to
|
|
19
|
+
TagLib they must be contributed back to the project. Please review the
|
|
20
|
+
licenses if you are considering using TagLib in your project.
|
|
21
|
+
|
|
22
|
+
[ID3v1]: https://id3.org/ID3v1
|
|
23
|
+
[ID3v2]: https://id3.org/Home
|
|
24
|
+
[Vorbis]: https://xiph.org/vorbis/
|
|
25
|
+
[Ogg]: https://www.xiph.org/ogg/
|
|
26
|
+
[Opus]: https://opus-codec.org/
|
|
27
|
+
[FLAC]: https://xiph.org/flac/
|
|
28
|
+
[Speex]: https://www.speex.org/
|
|
29
|
+
[APE]: https://www.monkeysaudio.com/
|
|
30
|
+
[MPC]: https://musepack.net/
|
|
31
|
+
[WavPack]: https://www.wavpack.com/
|
|
32
|
+
[WAV]: https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
|
|
33
|
+
[AIFF]: https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/AIFF.html
|
|
34
|
+
[TrueAudio]: https://sourceforge.net/projects/tta/
|
|
35
|
+
[Matroska]: https://www.matroska.org/
|
|
36
|
+
[WebM]: https://www.webmproject.org/
|
|
37
|
+
[GNU Lesser General Public License]: https://www.gnu.org/licenses/lgpl.html
|
|
38
|
+
[Mozilla Public License]: https://www.mozilla.org/MPL/MPL-1.1.html
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
export type { AudioFile, TypedAudioFile, } from "./src/taglib/audio-file-interface.js";
|
|
10
10
|
export { AudioFileImpl, createTagLib, TagLib } from "./src/taglib.js";
|
|
11
11
|
export type { MutableTag } from "./src/taglib.js";
|
|
12
|
+
export { isNamedAudioInput } from "./src/types/audio-formats.js";
|
|
12
13
|
export { EnvironmentError, FileOperationError, InvalidFormatError, isEnvironmentError, isFileOperationError, isInvalidFormatError, isMemoryError, isMetadataError, isTagLibError, isUnsupportedFormatError, MemoryError, MetadataError, SUPPORTED_FORMATS, TagLibError, TagLibInitializationError, UnsupportedFormatError, } from "./src/errors.js";
|
|
13
14
|
export type { TagLibErrorCode } from "./src/errors.js";
|
|
14
15
|
export { addPicture, applyCoverArt, applyPictures, applyTags, applyTagsToFile, type BatchItem, type BatchOptions, type BatchResult, clearPictures, clearTags, type FileMetadata, findPictureByType, isValidAudioFile, readCoverArt, readFormat, readMetadata, readMetadataBatch, readPictureMetadata, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setBufferMode, } from "./src/simple/index.js";
|
|
15
16
|
export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.js";
|
|
16
17
|
export type { PropertyMetadata } from "./src/constants/property-types.js";
|
|
17
18
|
export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataURLToPicture, displayPicture, imageFileToPicture, pictureToDataURL, setCoverArtFromCanvas, } from "./src/web-utils/index.js";
|
|
18
|
-
export type { AudioCodec, AudioFileInput, AudioProperties, BitrateControlMode, ContainerFormat, ExtendedTag, FieldMapping, FileType, OpenOptions, Picture, PictureType, PropertyMap, Tag, TagInput, TagName, } from "./src/types.js";
|
|
19
|
+
export type { AudioCodec, AudioFileInput, AudioProperties, BitrateControlMode, ContainerFormat, ExtendedTag, FieldMapping, FileType, NamedAudioInput, OpenOptions, Picture, PictureType, PropertyMap, Tag, TagInput, TagName, } from "./src/types.js";
|
|
19
20
|
export { BITRATE_CONTROL_MODE_NAMES, BITRATE_CONTROL_MODE_VALUES, PICTURE_TYPE_NAMES, PICTURE_TYPE_VALUES, } from "./src/types.js";
|
|
20
21
|
export type { PropertyKey, PropertyValue } from "./src/constants.js";
|
|
21
22
|
export type { FormatPropertyKey, TagFormat, } from "./src/types/format-property-keys.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,SAAS,EACT,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,SAAS,EACT,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OA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