title: javascript. alert when sound plays
body: <p>I am basically trying to make a auto better on earn.gg (dice)</p>
  
  <p>Is there a way to alert("win") if a sound is playing in the chrome tab? I will run the script in the console of that tab.</p>
  
  <p>I have tried to do "roll();" in the console and it rolled the dice and returned me "value:false" because i lost and when i win it returns me value:true.So i figured to use that and make the code below. That simply didn't work and returned me "win" every time. Screenshot: <a href="http://prntscr.com/fpeoxb" rel="nofollow noreferrer">http://prntscr.com/fpeoxb</a></p>
  
  <pre><code>roll();
  if(value=true){
     console.log("win");
  }else if(value=false){
     console.log("lose");
  }
  </code></pre>