@audiotool/nexus - v0.0.17
    Preparing search index...

    Type Alias SampleMeta

    SampleMeta: SamplePending & {
        durationSeconds: number;
        flacUrl: string;
        getWaveformUrl: (options?: WaveformUrlOptions) => string;
        mp3Url: string;
        previewMp3Url: string;
        wavUrl: string;
    }

    Complete sample metadata available after server-side processing completes. Extends SamplePending with download URLs for various audio formats.

    You can pass this directly to document.TransactionBuilder.insertSample, or pass a plain object with name, durationSeconds, and optional bpm.

    Type declaration

    • ReadonlydurationSeconds: number

      Duration of the sample in seconds.

    • ReadonlyflacUrl: string

      URL to download the sample in FLAC format.

    • ReadonlygetWaveformUrl: (options?: WaveformUrlOptions) => string

      Build a URL to fetch waveform visualization data.

      The URL returns gzipped JSON containing an array of non-negative peak values (one per time bin). Pick a WaveformResolution and a WaveformChannel; both default to a sensible middle ground (1920 peaks, "both" channels).

      // Default: 1920-peak combined-channel curve
      const url = sample.getWaveformUrl()

      // Detailed left-channel curve
      const url = sample.getWaveformUrl({ resolution: 3840, channel: "left" })
    • Readonlymp3Url: string

      URL to download the sample in MP3 format.

    • ReadonlypreviewMp3Url: string

      URL to download a low-quality MP3 preview.

    • ReadonlywavUrl: string

      URL to download the sample in WAV format.