taglib-ts
    Preparing search index...

    Function writeTags

    • Write tags to an audio file and return the modified audio data as a Uint8Array.

      The input data is copied into an in-memory buffer; the original input is never mutated. Only the fields present in tags are changed — any field that is undefined keeps its existing value in the file.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike> | null>

      The modified audio data as a Uint8Array, or null if the format is not recognised, the file is invalid, or the save failed.

      import { writeTags } from 'taglib';

      const modified = await writeTags(file, {
      title: 'My Track',
      artist: 'My Artist',
      year: 2024,
      });

      if (modified) {
      const blob = new Blob([modified], { type: 'audio/mpeg' });
      // offer blob for download, etc.
      }