Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get wav files to play on iPad using Safari
    primarykey
    data
    text
    <p>I have a web application that I have built and it needs to have three different kind of alerts. Single beep, long beep and triple beep. All the audio files are in .wav format. The application works as expected with all beep notifications playing at the right time on a Mac or PC, with IE, FireFox, Chrome and Safari on Mac.</p> <p>When I run the application on an iPad it only wants to play the single beep and will play it every time it is supposed to. When it's supposed to play the long beep or triple beep, it doesn't.</p> <p>Can somebody please tell me why this is happening and what I can do to get this working? This web application was built to run on the iPad and full web browsers. This is the last thing that needs to be worked out, before the application is completed.</p> <p>Thanks in advance. :)</p> <p>Here is my code for the audio tags and the javascript that makes it work.</p> <p><strong>HTML</strong></p> <pre><code> &lt;span style="visibility:hidden; display: none; "&gt; &lt;audio src="./sounds/beep.wav"&gt;&lt;/audio&gt; &lt;audio src="./sounds/longBeep.wav"&gt;&lt;/audio&gt; &lt;audio src="./sounds/tripleBeep.wav"&gt;&lt;/audio&gt; &lt;/span&gt; </code></pre> <p><strong>JavaScript</strong></p> <pre><code> function playBeep() { var beepAudio = document.getElementsByTagName('audio')[0]; beepAudio.play(); } function playLongBeep() { var beepAudio = document.getElementsByTagName('audio')[1]; beepAudio.play(); } function playTripleBeep() { var beepAudio = document.getElementsByTagName('audio')[2]; beepAudio.play(); } </code></pre> <p>All the audio files are using the same codec and the format.</p> <p><img src="https://i.stack.imgur.com/WHODv.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload