slightly better

This commit is contained in:
2025-10-06 02:16:23 +02:00
parent ba37b94908
commit ac772054c9
35 changed files with 1874 additions and 390 deletions

View File

@ -12,6 +12,7 @@ class BytebeatProcessor extends AudioWorkletProcessor {
this.sampleRate = 8000
this.duration = 4
this.loopLength = this.sampleRate * this.duration
this.playbackRate = 1.0
this.error = false
this.port.onmessage = (event) => {
@ -32,6 +33,9 @@ class BytebeatProcessor extends AudioWorkletProcessor {
case 'loopLength':
this.loopLength = value
break
case 'playbackRate':
this.playbackRate = value
break
}
}
}
@ -71,7 +75,7 @@ class BytebeatProcessor extends AudioWorkletProcessor {
}
}
this.t++
this.t += this.playbackRate
if (this.loopLength > 0 && this.t >= this.loopLength) {
this.t = 0
}