I notice you didn't use
$(document).ready(). (Or equivalent,
$(function{}) ) (You use it further down the page, but not in the first part of the code.)
You need to wait for document ready before trying to use selectors in JS code. Otherwise, the element(s) you are selecting may not yet exist. pButton might not yet exist when:
$('#pButton').on('click', playAudio);
is run.
What is the purpose of your 300mSec delay? I would guess it is because you didn't use document ready you added an arbitrary delay. If so, of course your delay is a guess that might work on some browsers and networks, but not on others.