import { WavFile } from "@opendaw/lib-dsp";
import { Promises } from "@opendaw/lib-runtime";
import { Files } from "@opendaw/lib-dom";
export var AudioWavExport;
(function (AudioWavExport) {
    AudioWavExport.toFile = async (owner, suggestedName = "audio.wav") => {
        const data = owner.file.data.unwrap("Audio data is not loaded");
        return Promises.tryCatch(Files.save(WavFile.encodeFloats(data), {
            types: [{
                    description: "Wav File",
                    accept: { "audio/wav": [".wav"] }
                }], suggestedName
        }));
    };
})(AudioWavExport || (AudioWavExport = {}));
