elsmr / mp3-mediarecorder

šŸŽ™MediaRecorder ponyfill that records audio as mp3

Home Page:https://mp3-mediarecorder.elsmr.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminating a worker

KeysonG opened this issue Ā· comments

Hi! Thanks for the great lib, its awesome :)

How would I terminate a worker so they do not still show up in the Chrome Memory tab.

Thanks again!

Hi :) Thanks for your kind words

You could call terminate on the worker instance you pass to the Mp3MediaRecorder constructor. Keep in mind the recorder won't work anymore after terminating the worker (you'll have to create a new recorder with a new worker).

const recorder = new Mp3MediaRecorder(stream, { worker: myWorker });
myWorker.terminate()

Hope that solves your issue!

Thank you!