Better export UI

This commit is contained in:
Nikita 2025-10-20 20:19:52 +03:00
parent 418bca79b2
commit ff83994733
8 changed files with 195 additions and 109 deletions

View file

@ -112,14 +112,12 @@ export class Cyclist {
this.setStarted(true);
}
async exportAudio(begin, end) {
async exportAudio(begin, end, sampleRate, downloadName = undefined) {
if (!this.pattern) {
throw new Error('Scheduler: no pattern set! call .setPattern first.');
}
logger('[cyclist] exporting');
// this.clock.start();
// this.setStarted(true);
await renderPatternAudio(this.pattern, this.cps, begin, end)
await renderPatternAudio(this.pattern, this.cps, begin, end, sampleRate, downloadName)
}
pause() {

View file

@ -91,7 +91,7 @@ export function repl({
const stop = () => scheduler.stop();
const start = () => scheduler.start();
const exportAudio = async (begin, end) => await scheduler.exportAudio(begin, end);
const exportAudio = async (begin, end, sampleRate, downloadName = undefined) => await scheduler.exportAudio(begin, end, sampleRate, downloadName);
const pause = () => scheduler.pause();
const toggle = () => scheduler.toggle();
const setCps = (cps) => {