Function toArrayBuffer

  • Generate an ArrayBuffer from a Song.


    import { writeFileSync } from "node:fs";
    import { Song, toArrayBuffer } from "@nbsjs/core";

    const song = new Song();

    // ...do what you need with the song

    const exportedBuffer = toArrayBuffer(song, {
    "ignoreEmptyLayers": true
    });

    writeFileSync("output.nbs", new Uint8Array(exportedBuffer));

    Parameters

    • song: Song

      Song to parse from

    • options: ToArrayBufferOptions = defaultToArrayBufferOptions

      Optional arguments that impact export behavior

    Returns ArrayBufferLike

    Generated array buffer, empty if unsuccessful