Cómo cambiar el icono de juego a pausa en JavaScript

<script>
    function toggleSound() {
       var audioElem = document.getElementById('player');
       if (audioElem.paused) {
          audioElem.className = "fa fa-play";
          audioElem.play();
       } else {
          audioElem.className = "fa fa-pause";
          audioElem.pause();
       }
    }
</script>
Bloody Bee