With TTS Piper (I've only used Alba so far), seems to be a memory leak, that freezes my entire system after a while. I've been using the extension directly from Chrome extensions. I fired it in the Gemini Antigravity and it suggested the memory leak and came up with a fix, saying the js/player.js isn't revoking Object URLs for blobs and that's the issue, I haven't cloned this repo. But thought I would open an bug report first. See thoughts. I haven't tested the fix Antigravity proposed yet so didn't want to submit a PR but thought I'd just let folks now.
I'll copy the code change suggestion here. Incase anyone else wants to test it, before I can make sure it isn't crashing and if not later submit a PR
play(src, rate, volume) { if (current) current.playback.unsubscribe() const isBlob = src instanceof Blob const url = isBlob ? URL.createObjectURL(src) : src const playbackState$ = new rxjs.BehaviorSubject("resumed") return new Promise((fulfill, reject) => { const cleanup = () => { if (isBlob) URL.revokeObjectURL(url) } current = { playbackState$, playback: playAudio(Promise.resolve(url), {rate, volume}, playbackState$).subscribe({ complete: () => { cleanup() fulfill() }, error: err => { cleanup() reject(err) } }) } }) },
With TTS Piper (I've only used Alba so far), seems to be a memory leak, that freezes my entire system after a while. I've been using the extension directly from Chrome extensions. I fired it in the Gemini Antigravity and it suggested the memory leak and came up with a fix, saying the js/player.js isn't revoking Object URLs for blobs and that's the issue, I haven't cloned this repo. But thought I would open an bug report first. See thoughts. I haven't tested the fix Antigravity proposed yet so didn't want to submit a PR but thought I'd just let folks now.
I'll copy the code change suggestion here. Incase anyone else wants to test it, before I can make sure it isn't crashing and if not later submit a PR
play(src, rate, volume) { if (current) current.playback.unsubscribe() const isBlob = src instanceof Blob const url = isBlob ? URL.createObjectURL(src) : src const playbackState$ = new rxjs.BehaviorSubject("resumed") return new Promise((fulfill, reject) => { const cleanup = () => { if (isBlob) URL.revokeObjectURL(url) } current = { playbackState$, playback: playAudio(Promise.resolve(url), {rate, volume}, playbackState$).subscribe({ complete: () => { cleanup() fulfill() }, error: err => { cleanup() reject(err) } }) } }) },