To pile on to all the other good advice, note that a lot of browsers are restricting playback of audio unless it happens under the context of a user event (like a mouse click or touch) first. You may want to check the console.log and see if that is happening.