Ask coding questions

← Back to all posts
How do i stop music when the repl is stopped?
codingMASTER398

Currently, I'm using the @replit/audio library in nodejs to play music.
But, when I stop the repl, the music keeps playing.

What can I do to stop this?

Voters
codingMASTER398
Comments
hotnewtop
CodeMaster007

Reload the page.

codingMASTER398

@CodeMaster007 anyway I can stop it without reloading the page?

CodeMaster007

I'm not sure what your problem is specifically. Is this what your looking for....sound.pause();? @codingMASTER398

codingMASTER398

@CodeMaster007 i can use sound.pause but not when the project is stopped. There is no way to detect when the app is stopped.