Generate an ArrayBuffer from a Song.
ArrayBuffer
Song
import { writeFileSync } from "node:fs";import { Song, toArrayBuffer } from "@nbsjs/core";const song = new Song();// ...do what you need with the songconst exportedBuffer = toArrayBuffer(song, { "ignoreEmptyLayers": true});writeFileSync("output.nbs", new Uint8Array(exportedBuffer)); Copy
import { writeFileSync } from "node:fs";import { Song, toArrayBuffer } from "@nbsjs/core";const song = new Song();// ...do what you need with the songconst exportedBuffer = toArrayBuffer(song, { "ignoreEmptyLayers": true});writeFileSync("output.nbs", new Uint8Array(exportedBuffer));
Song to parse from
Optional arguments that impact export behavior
Generated array buffer, empty if unsuccessful
Generate an
ArrayBuffer
from aSong
.Example