Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Playing Audio Using Keystrokes: Is It Possible?

Annabelle5893

Gold Coder
I'm wondering, how would I make an app that plays audio files using the keys on the number pad? Specifically, I want to make an app that triggers "Rotary Pulse 1" by pressing 1 on the numeric keypad, all the way up to "Rotary Pulse 0" on the 0 key. A dial tone will be toggled on by pressing the spacebar, which will begin with a "receiver pickup" noise. The dial tone turns off when digits are dialed via the numeric keypad. If you press the spacebar either when the dial tone is on, or after dialing a number, a "Receiver Hang Up" noise will be triggered. With the rotary dial sounds, the dial turning to the fingerhole is triggered at key down, and the release of the dial returning to the resting position will be triggered by releasing of the number corresponding to the fingerhole (1, 2, 3, 4, 5, 6, 7, 8, 9, 0). This will be accompanied by the internal sound of the dial pulses as heard in a telephone. What is the code I would use to make this audio app using HTML?
 
What does it mean when it says, "The user didn't interact with the document"? Is it because the file names are wrong? Maybe the keystrokes are not coded the way they should be? I'm confused!
It means that when the html file is loaded the file wants to play the audio files, but cannot fully due to the same policy stopping it. So I was digging around and I found a post about this exact same issue from about 5 years ago. The author of the post made this comment about what Google said about it in their docs
Code:
Google states: Autoplay with sound is allowed if:

[LIST]
[*]User has interacted with the domain (click, tap, etc.).
[*]On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
[*]On mobile, the user has added the site to his or her home screen.
[/LIST]
Mousemove no longer counts as "an event" or "interaction".

Wondering if there's a solid workaround for this as not autoplaying the login splash soundtrack will be odd and ruin the user gaming experience. Workarounds I've tried are to have an autoclick event happen, or autoreloading the page if it's their first time. Otherwise, I can try loading the game engine for the login page and playing thru canvas audio.

Someone made a comment about this:
Code:
There is a good reason for this precaution: Users usually don't expect audio from websites. They get really angry when they load a website, and an audio advertisement blares at them at full volume. This is even worse if they opened multiple tabs and are not sure which one is responsible. That's why all browser vendors prevent websites from playing audio unless the user interacts with them. Yes, I understand that you want to use this feature for good and not evil, but if there was a workaround, that workaround could also be used by the advertisers. So be glad that such a workaround does not exist.

So the only real solution is to find some reason why the player would need to perform some form of interaction after the game HTML document is loaded. A good excuse is some kind of initial screen with a copyright message and other legalese which disappears after the user clicked on it. You can also use this splash screen as a preloader for the assets needed for your login screen. That makes sure the background music is actually loaded when a user with a low bandwidth connection sees it.
 
Good news is: there does seem to be a workaround, but the bad part is I am not sure if the solution will solve your issue. I will play around with the solution and get back to you within a day or two. I want to make sure that it does indeed work and can fit with your solution before posting it here for you. First time I've encountered this issue myself, so you're not alone in the frustration 🙂
 
It means that when the html file is loaded the file wants to play the audio files, but cannot fully due to the same policy stopping it. So I was digging around and I found a post about this exact same issue from about 5 years ago. The author of the post made this comment about what Google said about it in their docs
Code:
Google states: Autoplay with sound is allowed if:

[LIST]
[*]User has interacted with the domain (click, tap, etc.).
[*]On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
[*]On mobile, the user has added the site to his or her home screen.
[/LIST]
Mousemove no longer counts as "an event" or "interaction".

Wondering if there's a solid workaround for this as not autoplaying the login splash soundtrack will be odd and ruin the user gaming experience. Workarounds I've tried are to have an autoclick event happen, or autoreloading the page if it's their first time. Otherwise, I can try loading the game engine for the login page and playing thru canvas audio.

Someone made a comment about this:
Code:
There is a good reason for this precaution: Users usually don't expect audio from websites. They get really angry when they load a website, and an audio advertisement blares at them at full volume. This is even worse if they opened multiple tabs and are not sure which one is responsible. That's why all browser vendors prevent websites from playing audio unless the user interacts with them. Yes, I understand that you want to use this feature for good and not evil, but if there was a workaround, that workaround could also be used by the advertisers. So be glad that such a workaround does not exist.

So the only real solution is to find some reason why the player would need to perform some form of interaction after the game HTML document is loaded. A good excuse is some kind of initial screen with a copyright message and other legalese which disappears after the user clicked on it. You can also use this splash screen as a preloader for the assets needed for your login screen. That makes sure the background music is actually loaded when a user with a low bandwidth connection sees it.
That was certainly an earful for me to hear. However, I'm still not sure what to do to make my app work as intended. I know all my files are .mp3 format, and I want to trigger them with keystrokes. But now I'm so confused on which way to turn.
 
That was certainly an earful for me to hear. However, I'm still not sure what to do to make my app work as intended. I know all my files are .mp3 format, and I want to trigger them with keystrokes. But now I'm so confused on which way to turn.
Believe me, I completely understand, having been there myself plenty of times. This is just a temporary obstacle that can, and will be overcome, I guarantee you. I did see from your screenshot, that you are still getting errors about certain files not being found. I did notice that in the zip you sent me, there were 2, possibly 3 folders that you referenced in your html file that do not have any audio files in them. At least not in the version you sent me. Can you make sure that those files are there on your end? I will post the ones that I am getting in a minute.
 
These are the files that I am seeing give an error message on my end:
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%203.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%204.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%205.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%206.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%207.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%208.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%209.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Star.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%200.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Pound.mp3
  • Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3
  • Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3
 
These are the files that I am seeing give an error message on my end:
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%203.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%204.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%205.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%206.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%207.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%208.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%209.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Star.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%200.mp3
  • DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Pound.mp3
  • Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3
  • Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3
I notice you listed "Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3" twice. There's only supposed to be one file with that name. Yes, I do have all the files you've listed.
 
The error message that comes with all of these is this:
Code:
Failed to load resource: net::ERR_FILE_NOT_FOUND
Is that error pertaining to just the Princess 702B Bell Ring file, or all the files you listed? As for the "DTMF Tone Dial" files, they're all there where they should be, so I'm not sure what happened there.
 
How does this look? I've modified it to include an Autoplay parameter within the HTML code. Tell me if this looks right to you.
Code:
<html>
<div role="switch" aria-labelledby="id-label">
  <label for="Hookswitch Status"
  <button type="button"
          role="switch"
  id="hookswitch">Hookswitch Status:
    <span class="hookStatus off">
    </span>
  </label>
  </button>
</div>
    <audio controls autoplay>
<audio id="dialTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Dial%20Tone/USA%20Dial%20Tone.mp3"></audio>
<audio id="busyTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Busy%20Tone/USA%20Busy%20Tone.mp3"></audio>
<audio id="RingbackTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Ringback%20Tone/USA%20Ringback%20Tone.mp3"></audio>
<audio id="TimeoutHowler" type="audio/mpeg"> src="Call%20Progress%20Tones/Receiver%20Off%20Hook%20Tone/USA%20Receiver%20Off%20Hook%20Tone.mp3"></audio>
<audio id="RingingTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3"></audio>
<audio id="DTMFToneDial1" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3"></audio>
<audio id="DTMFToneDial2" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3"></audio>
<audio id="DTMFToneDial3" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%203.mp3"></audio>
<audio id="DTMFToneDial4" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%204.mp3"></audio>
<audio id="DTMFToneDial5" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%205.mp3"></audio>
<audio id="DTMFToneDial6" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%206.mp3"></audio>
<audio id="DTMFToneDial7" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%207.mp3"></audio>
<audio id="DTMFToneDial8" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%208.mp3"></audio>
<audio id="DTMFToneDial9" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%209.mp3"></audio>
<audio id="DTMFToneDialStar" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Star.mp3"></audio>
<audio id="DTMFToneDial0" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%200.mp3"></audio>
<audio id="DTMFToneDialPound" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Pound.mp3"></audio>
<audio id="OneSlotUSAPayphoneNickelTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Nickel%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneDimeTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Dime%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneQuarterTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Quarter%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneHalfDollarTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Half%20Dollar%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneDollarTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Dollar%20Tone.mp3"></audio>
    <p>Click the buttons or press keyboard shortcuts to hear sounds</p>
<div id="DTMF" style="display: block;">
<center><p class="TONETYPE">DTMF DIALING TONES</p></center>
<button type="button" id="DTMF1">1</button>
<button type="button" id="DTMF2">2</button>
<button type="button" id="DTMF3">3</button>
<button type="button" id="DTMF4">4</button>
<button type="button" id="DTMF5">5</button>
<button type="button" id="DTMF6">6</button>
<button type="button" id="DTMF7">7</button>
<button type="button" id="DTMF8">8</button>
<button type="button" id="DTMF9">9</button>
<button type="button" id="DTMFStar">Star</button>
<button type="button" id="DTMF0">0</button>
<button type="button" id="DTMFPound">Pound</button>
</div>
<div id="ACTS" style="display: block;">
<center><p class="TONETYPE">1-SLOT COIN DEPOSIT SOUNDS</p></center>
<button type="button" id="ACTS5">$0.05</button>
<button type="button" id="ACTS10">$0.10</button>
<button type="button" id="ACTS25">$0.25</button>
<button type="button" id="ACTS50">$0.50</button>
<button type="button" id="ACTS100">$1.00</button>
</div>
<script>
var hookSwitch = document.querySelector('button.hookSwitch');
    var hookStatus = document.querySelector('span.hookStatus');
hookStatus.addEventListener("click", function(){
    if ( hookStatus.classlist.contains('off') ){
        //remove 'off' class
        hookStatus.classlist.remove('off');  
        //add 'on' class
        hookStatus.classlist.add('on');
        //change span text
        hookStatus.textContent = "Off Hook";  
    }
    else {
        if ( hookStatus.classlist.contains('on') ){
            //remove 'on' class
            hookStatus.classlist.remove('on');  
            //add 'off' class
            hookStatus.classlist.add('off');
            //change span text
            hookStatus.textContent = "Off Hook";
        }
    }
})
var dialTone=new Audio('Call%20Progress%20Tones/Dial%20Tone/USA%20Dial%20Tone.mp3');
var isOffHook=false;
var callIncoming=false;
var allowDial = true;
var ringingTone=new Audio('Ringing Tone/Princess%20702B%20Bell%20Ring.mp3');
var timesRung=0;
var availableNumbers=["0","611","711","811","911","*67 + 1 (847) 765-1008","1 (847) 765-1008","867-5309",
                        "1 (212) 456-1414","555-1212","555-5555","748-0900","650-0050","650-8950",
                        "970-3920","1 (714) 733-9969","*57","*69"];


function reload(){
    location.reload(true);
}

function toggleLineStatus() {
    var number="";
    var pin="";
    var checkForPin=false;
    document.getElementById('numberbeingdialed').innerHTML=number;
    var wasOnHook=false;

    if(!offHook){
        offHook=true;
        document.getElementById('hookstatus').innerHTML="Off";
        wasOnHook=true;
    } else {
        offHook=false;
        document.getElementById('hookstatus').innerHTML="On";
        clunk.pause();
        ringback.pause();
        clunk.currentTime=0;
        ringback.currentTime=0;
    }
 
    if(ringbackDialed){
        startRingback();
    } else {
        if(wasOnHook){
            ring.pause();
            ring.currentTime=0;
            playDialTone();
            dialingAllowed=true;
            nextDigitDialable=true;
            ringbackDialed=false;
            keepPlaying=true;
        }
        else {
            stopDialTone();
            setOpacity(100);
            allCircuitsBusy=false;
            keepPlaying=false;
        }
    }
}

function numberSuggestion(){
    var randomNumber=Math.floor(Math.random()*(availableNumbers.length));
    var suggestedNumber=availableNumbers[randomNumber];
    document.getElementById("suggestion").innerHTML="How about dialing <strong id='suggestedTelephoneNumber'>"+
                                                    suggestedNumber+
                                                    "</strong>? Don't like this number? Click the button above again!";
}

function receiverRaised(){
    if(allowDial == false) {
        telephoneAnswered()
    }
 
    if(allowDial == true) {
        dialTone.play();
    } else {
        offHook ();
        timeoutHowler.play();
    }
}

setCallTimeout();

function setCallTimeout(){
    var delay=5000;
    var delayCaller=Math.floor((Math.random()*8000)+1);
    delay=delay+delayCaller;
    setTimeout(incomingCall,delay);
}

function offHook(){
    isOffHook=true;
    document.getElementById("WE2500").style.display="none";
    document.getElementById("dialPad").style.display="block";
}

function dialToneTimedOut() {
    allowDial=false;
    timeoutHowler();
    if(DialToneTimedOut == true) {
        timeoutHowler.play();
        timeoutHowler.currentTime=0;
    }
}
    var ringRing=new Audio('Ringing Tone/Princess%20702B%20Bell%20Ring.mp3');
    var hasTelephoneBeenAnswered=false;
    ringTelephone();

function incomingCall(){
}

function ringTelephone(){
    if(!hasTelephoneBeenAnswered) {
        ringRing.play();
        ringRing.currentTime=0;
    }
     else {
    if(isOffHook == false) {
        ringRing.play();
    }
    if(allowDial == false) {
        callIncoming=true;
        setInterval(ringTelephone,5500);
    }
}

var number="";
var timeout="";

function numberDial() {
    if(dialTone){
        dialTone.pause();
        dialTone.currentTime=0
    }
}

function dial1() {
    if(allowDial == true) {
        numberDial();
        number=number+"1";
        var DTMFToneDial1=new Audio('DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3');
        DTMFToneDial1.play();
    }
}

function dial2() {
    if(allowDial == true); {
        numberDial();
        number=number+"2";
        var DTMFToneDial2=new Audio('DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3');
        DTMFToneDial2.play();
    }
}

function dial3() {
    if(allowDial == true); {
        numberDial();
        number=number+"3";
        var DTMFToneDial3=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 3.mp3');
        DTMFToneDial3.play();
    }
}

function dial4() {
    if(allowDial == true) {
        numberDial();
        number=number+"4";
        var DTMFToneDial4=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 4.mp3');
        DTMFToneDial4.play();
    }
}

function dial5() {
    if(allowDial == true) {
        numberDial();
        number=number+"5";
        var DTMFToneDial5=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 5.mp3');
        DTMFToneDial5.play();
    }
}

function dial6() {
    if(allowDial == true) {
        numberDial();
        number=number+"6";
        var DTMFToneDial6=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 6.mp3');
        DTMFToneDial6.play();
    }
}

function dial7() {
    if(allowDial == true) {
        numberDial();
        number=number+"7";
        var DTMFToneDial7=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 7.mp3');
        DTMFToneDial7.play();
    }
}

function dial8() {
    if(allowDial == true) {
        numberDial();
        number=number+"8";
        var DTMFToneDial8=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 8.mp3');
        DTMFToneDial8.play();
    }
}

function dial9() {
    if(allowDial == true) {
        numberDial();
        number=number+"9";
        var DTMFToneDial9=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 9.mp3');
        DTMFToneDial9.play();
    }
}

function dialStar() {
    if(allowDial == true) {
        numberDial();
        number=number+"*";
        var DTMFToneDialStar=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial Star.mp3');
        DTMFToneDialStar.play();
    }
}

function dial0() {
    if(allowDial == true) {
        numberDial();
        number=number+"0";
        var DTMFToneDial0=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 0.mp3');
        DTMFToneDial0.play();
    }
}

function dialPound(){
    if(allowDial == true) {
        numberDial();
        number=number+"#";
        var DTMFToneDialPound=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial Pound.mp3');
        DTMFToneDialPound.play();
    }
}

//this is missing a closing bracket for the function itself at the end
document.onkeydown = function (event) {
    switch (event.keycode) {
        case 13:
            button.addEventListener('click', function() {
                        toggleLineStatus();
            })
            break;
        case 49,97:
            button.addEventListener('click', function() {
                        dial1();
            })
            break;
        case 50,98:
            button.addEventListener('click', function() {
                        dial2();
            })
            break;
        case 51,99:
            button.addEventListener('click', function() {
                        dial3();
            })
            break;
        case 52,100:
            button.addEventListener('click', function() {
                        dial4();
            })
            break;
        case 53,101:
            button.addEventListener('click', function() {
                        dial5();
            })
            break;
        case 54,102:
            button.addEventListener('click', function() {
                        dial6();
            })
            break;
        case 55,103:
            button.addEventListener('click', function() {
                        dial7();
            })
            break;
        case 56,104:
            button.addEventListener('click', function() {
                        dial8();
            })
            break;
        case 57,105:
            button.addEventListener('click', function() {
                        dial9();
            })
            break;
        case 106:
            button.addEventListener('click', function() {
                        dialStar();
            })
            break;
        case 48,96:
            button.addEventListener('click', function() {
                        dial0();
            })
            break;
        case 109:
            button.addEventListener('click', function() {
                        dialPound();
            })
            break;
}
}

//this function is missing a closing bracket for the function itself at the end
function ring() {
    ringingTone.play();
    timesRung++;
    if(timesRung>1) {
        setTimeout(response,700);
    }
    }

function dial(){
    allowDial=false;
    ring();
    setTimeout(ring,4000);
}


function busy() {
    busyTone();
    }

function busyTone() {
    var pickupBusy=new Audio('Call%20Progress%20Tones/Busy%20Tone/USA%20Busy%20Tone.mp3');
    pickupBusy.play();
    pickupBusy.currentTime=0;
    setInterval(busyTone,4000);
    }
    
function operatorPutCallThrough() {
    operatorPickup.play(true);
}

function response(){
    switch(number) {
        case "0":
            var operatorPickup=new Audio('callResponses/OperatorAnswer.wav');
            operatorPickup.addEventListener("click", function() {
                number=prompt("Operator, your number please? (Numbers only; enter 'police' for police and emergency)");
                if(number==null){
                    number="0";
                }
})
            break;
        case "611":
            var pickup611=new Audio('callResponses/611.wav');
            pickup611.addEventListener("click", function(){
                timeoutHowler();
                pickup611.play();
            })
            break;
        case "711":
            var pickup711=new Audio('callResponses/tdd-1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup711.addEventListener("click", function() {
                timeoutHowler();
                pickup711.play();
            })
            break;
        case "811":
            var pickup811=new Audio('callResponses/811.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup811.addEventListener("click", function() {
                timeoutHowler();
                pickup811.play();
            })
            break;
        case "911":
            var pickup911=new Audio('callResponses/911-xxx-fleet.mp3');
            pickup911.addEventListener("click", function() {
                timeoutHowler();
                pickup911.play();
            })
            break;
        case "18477651008":
            var pickupMCI=new Audio('callResponses/MCI.wav');
            pickupMCI.addEventListener("click", function() {
                timeoutHowler();
                pickupMCI.play();
            })
            break;
        case "8675309":
            var pickup8675309=new Audio('callResponses/discoornis-bell-f1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup8675309.addEventListener("click", function () {
                timeoutHowler();
                pickup8675309.play();
            })
            break;
        case "12124561414":
            var pickup12124561414=new Audio('callResponses/discoornis-bell-f1.mp3');
            pickup12124561414.addEventListener("click", function() {
                busy();
                pickup12124561414.play();
            })
            break;
        case "5551212":
            var pickup5551212=new Audio('callResponses/Dirassist-bell-f1.mp3');
            pickup5551212.addEventListener("click", function() {
                busy();
                pickup5551212.play();
            })
            break;
        case "5555555":
            var pickup5555555=new Audio('callResponses/timeout-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup5555555.addEventListener("click", function() {
                timeoutHowler();
                pickup5555555.play();
            })
            break;
        case "7480900":
            var pickupSelf=new Audio('callResponses/partyline-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupSelf.addEventListener("click", function() {
                busy();
                pickupSelf.play();
            })
            break;
        case "18005820655":
            var pickup18005820655=new Audio('callResponses/discoornis-bell-f1.mp3');
            pickup18005820655.addEventListener("click", function() {
                busy();
                pickup18005820655.play();
            })
            break;
        case "6508950":
            var pickupAM=new Audio('callResponses/answering-machine-1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupAM.addEventListener("click", function() {
                pickupAM.play();
            })
            break;
        case "6500050":
            var pickupModem=new Audio('modem.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupModem.addEventListener("click", function() {
                pickupModem.play();
            })
            break;
        case "9703920":
            var pickupFax=new Audio('fax-1.mp3');
            pickupFax.addEventListener("click", function() {
                pickupFax.play();
            })
            break;
        case "17147339969":
            var pickup714=new Audio('device-conference.mp3');
            pickup714.addEventListener("click", function() {
                pickup714.play();
            })
            break;
        case "8217147339969":
            var pickup8217147339969=new Audio('device-conference.mp3');
            pickup8217147339969.addEventListener("click", function() {
            pickup8217147339969.play(); //remove the space before the asterisk
            })
            break;
        case "*6717147339969":
            var pickup6717147339969=new Audio('callResponses/reject2-xxx-fleet.mp3');
            pickup6717147339969.addEventListener("click", function() {
                timeoutHowler();
                pickup714block.play();
            })
            break;
        case "*57":
            var randNum57=Math.random()>=0.5;
            if(randNum57) {
                var pickupCallTrace=new Audio('callResponses/trace3-xxx-fleet.mp3');
            }
            else {
                var pickupCallTrace=new Audio('callResponses/trace-xxx-fleet.mp3');
                pickupCallTrace.addEventListener("click", function() {
                    timeoutHowler();
                    pickupCallTrace.play();
                })
}
            break;
        case "*69":
            var pickupStar69=new Audio('callResponses/return-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupStar69.addEventListener("click", function() {
                timeoutHowler();
                pickupStar69.play();
            })
            break;
        case "police":
            var pickupPolice=new Audio('callResponses/policePickup.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupPolice.addEventListener("click", function() {
                timeoutHowler();
                pickupPolice.play();
                var policeComplaint=prompt("Police Department, Sergeant Duffy Speaking.");
                confirm("Really? You say that "+policeComplaint);
})  
          var policeHangup=new Audio('callResponses/policeHangup.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            policeHangup.addEventListener("click", function() {
                timeoutHowler();
            })
            break;
        default:
            var pickupDefault;
            if(number.length>7){
                pickupDefault=new Audio('callResponses/ldcircuits-bell-f1.mp3');
            }
            else {
                pickupDefault=new Audio('callResponses/completeordc-xxx-fleet.mp3');
                pickupDefault.addEventListener("click", function() {
                    timeoutHowler();
                    pickupDefault.play();
                })
                }
            break;
    }
}
}
</script>

</BODY>
</HTML>
 
I found this. View attachment 2481
And I set the permissions to "Allow Audio And Video". Still, nothing's changed! What do I do next? Also, where do I access page permissions in Microsoft Edge?
I found this for you: when you open up edge, go to the url bar, and enter this
Code:
edge://settings/content/mediaAutoplay
that should take you to the autoplay permissions section
 
How does this look? I've modified it to include an Autoplay parameter within the HTML code. Tell me if this looks right to you.
Code:
<html>
<div role="switch" aria-labelledby="id-label">
  <label for="Hookswitch Status"
  <button type="button"
          role="switch"
  id="hookswitch">Hookswitch Status:
    <span class="hookStatus off">
    </span>
  </label>
  </button>
</div>
    <audio controls autoplay>
<audio id="dialTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Dial%20Tone/USA%20Dial%20Tone.mp3"></audio>
<audio id="busyTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Busy%20Tone/USA%20Busy%20Tone.mp3"></audio>
<audio id="RingbackTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Ringback%20Tone/USA%20Ringback%20Tone.mp3"></audio>
<audio id="TimeoutHowler" type="audio/mpeg"> src="Call%20Progress%20Tones/Receiver%20Off%20Hook%20Tone/USA%20Receiver%20Off%20Hook%20Tone.mp3"></audio>
<audio id="RingingTone" type="audio/mpeg"> src="Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3"></audio>
<audio id="DTMFToneDial1" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3"></audio>
<audio id="DTMFToneDial2" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3"></audio>
<audio id="DTMFToneDial3" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%203.mp3"></audio>
<audio id="DTMFToneDial4" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%204.mp3"></audio>
<audio id="DTMFToneDial5" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%205.mp3"></audio>
<audio id="DTMFToneDial6" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%206.mp3"></audio>
<audio id="DTMFToneDial7" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%207.mp3"></audio>
<audio id="DTMFToneDial8" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%208.mp3"></audio>
<audio id="DTMFToneDial9" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%209.mp3"></audio>
<audio id="DTMFToneDialStar" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Star.mp3"></audio>
<audio id="DTMFToneDial0" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%200.mp3"></audio>
<audio id="DTMFToneDialPound" type="audio/mpeg"> src="DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%20Pound.mp3"></audio>
<audio id="OneSlotUSAPayphoneNickelTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Nickel%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneDimeTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Dime%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneQuarterTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Quarter%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneHalfDollarTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Half%20Dollar%20Tone.mp3"></audio>
<audio id="OneSlotUSAPayphoneDollarTone" type="audio/mpeg"> src="Payphone%20Coin%20Tones/One-Slot%20Payphone/USA%20Payphone%20Dollar%20Tone.mp3"></audio>
    <p>Click the buttons or press keyboard shortcuts to hear sounds</p>
<div id="DTMF" style="display: block;">
<center><p class="TONETYPE">DTMF DIALING TONES</p></center>
<button type="button" id="DTMF1">1</button>
<button type="button" id="DTMF2">2</button>
<button type="button" id="DTMF3">3</button>
<button type="button" id="DTMF4">4</button>
<button type="button" id="DTMF5">5</button>
<button type="button" id="DTMF6">6</button>
<button type="button" id="DTMF7">7</button>
<button type="button" id="DTMF8">8</button>
<button type="button" id="DTMF9">9</button>
<button type="button" id="DTMFStar">Star</button>
<button type="button" id="DTMF0">0</button>
<button type="button" id="DTMFPound">Pound</button>
</div>
<div id="ACTS" style="display: block;">
<center><p class="TONETYPE">1-SLOT COIN DEPOSIT SOUNDS</p></center>
<button type="button" id="ACTS5">$0.05</button>
<button type="button" id="ACTS10">$0.10</button>
<button type="button" id="ACTS25">$0.25</button>
<button type="button" id="ACTS50">$0.50</button>
<button type="button" id="ACTS100">$1.00</button>
</div>
<script>
var hookSwitch = document.querySelector('button.hookSwitch');
    var hookStatus = document.querySelector('span.hookStatus');
hookStatus.addEventListener("click", function(){
    if ( hookStatus.classlist.contains('off') ){
        //remove 'off' class
        hookStatus.classlist.remove('off');
        //add 'on' class
        hookStatus.classlist.add('on');
        //change span text
        hookStatus.textContent = "Off Hook";
    }
    else {
        if ( hookStatus.classlist.contains('on') ){
            //remove 'on' class
            hookStatus.classlist.remove('on');
            //add 'off' class
            hookStatus.classlist.add('off');
            //change span text
            hookStatus.textContent = "Off Hook";
        }
    }
})
var dialTone=new Audio('Call%20Progress%20Tones/Dial%20Tone/USA%20Dial%20Tone.mp3');
var isOffHook=false;
var callIncoming=false;
var allowDial = true;
var ringingTone=new Audio('Ringing Tone/Princess%20702B%20Bell%20Ring.mp3');
var timesRung=0;
var availableNumbers=["0","611","711","811","911","*67 + 1 (847) 765-1008","1 (847) 765-1008","867-5309",
                        "1 (212) 456-1414","555-1212","555-5555","748-0900","650-0050","650-8950",
                        "970-3920","1 (714) 733-9969","*57","*69"];


function reload(){
    location.reload(true);
}

function toggleLineStatus() {
    var number="";
    var pin="";
    var checkForPin=false;
    document.getElementById('numberbeingdialed').innerHTML=number;
    var wasOnHook=false;

    if(!offHook){
        offHook=true;
        document.getElementById('hookstatus').innerHTML="Off";
        wasOnHook=true;
    } else {
        offHook=false;
        document.getElementById('hookstatus').innerHTML="On";
        clunk.pause();
        ringback.pause();
        clunk.currentTime=0;
        ringback.currentTime=0;
    }
 
    if(ringbackDialed){
        startRingback();
    } else {
        if(wasOnHook){
            ring.pause();
            ring.currentTime=0;
            playDialTone();
            dialingAllowed=true;
            nextDigitDialable=true;
            ringbackDialed=false;
            keepPlaying=true;
        }
        else {
            stopDialTone();
            setOpacity(100);
            allCircuitsBusy=false;
            keepPlaying=false;
        }
    }
}

function numberSuggestion(){
    var randomNumber=Math.floor(Math.random()*(availableNumbers.length));
    var suggestedNumber=availableNumbers[randomNumber];
    document.getElementById("suggestion").innerHTML="How about dialing <strong id='suggestedTelephoneNumber'>"+
                                                    suggestedNumber+
                                                    "</strong>? Don't like this number? Click the button above again!";
}

function receiverRaised(){
    if(allowDial == false) {
        telephoneAnswered()
    }
 
    if(allowDial == true) {
        dialTone.play();
    } else {
        offHook ();
        timeoutHowler.play();
    }
}

setCallTimeout();

function setCallTimeout(){
    var delay=5000;
    var delayCaller=Math.floor((Math.random()*8000)+1);
    delay=delay+delayCaller;
    setTimeout(incomingCall,delay);
}

function offHook(){
    isOffHook=true;
    document.getElementById("WE2500").style.display="none";
    document.getElementById("dialPad").style.display="block";
}

function dialToneTimedOut() {
    allowDial=false;
    timeoutHowler();
    if(DialToneTimedOut == true) {
        timeoutHowler.play();
        timeoutHowler.currentTime=0;
    }
}
    var ringRing=new Audio('Ringing Tone/Princess%20702B%20Bell%20Ring.mp3');
    var hasTelephoneBeenAnswered=false;
    ringTelephone();

function incomingCall(){
}

function ringTelephone(){
    if(!hasTelephoneBeenAnswered) {
        ringRing.play();
        ringRing.currentTime=0;
    }
     else {
    if(isOffHook == false) {
        ringRing.play();
    }
    if(allowDial == false) {
        callIncoming=true;
        setInterval(ringTelephone,5500);
    }
}

var number="";
var timeout="";

function numberDial() {
    if(dialTone){
        dialTone.pause();
        dialTone.currentTime=0
    }
}

function dial1() {
    if(allowDial == true) {
        numberDial();
        number=number+"1";
        var DTMFToneDial1=new Audio('DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%201.mp3');
        DTMFToneDial1.play();
    }
}

function dial2() {
    if(allowDial == true); {
        numberDial();
        number=number+"2";
        var DTMFToneDial2=new Audio('DTMF%20Tone%20Dials/DTMF%20Tone%20Dial%202.mp3');
        DTMFToneDial2.play();
    }
}

function dial3() {
    if(allowDial == true); {
        numberDial();
        number=number+"3";
        var DTMFToneDial3=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 3.mp3');
        DTMFToneDial3.play();
    }
}

function dial4() {
    if(allowDial == true) {
        numberDial();
        number=number+"4";
        var DTMFToneDial4=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 4.mp3');
        DTMFToneDial4.play();
    }
}

function dial5() {
    if(allowDial == true) {
        numberDial();
        number=number+"5";
        var DTMFToneDial5=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 5.mp3');
        DTMFToneDial5.play();
    }
}

function dial6() {
    if(allowDial == true) {
        numberDial();
        number=number+"6";
        var DTMFToneDial6=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 6.mp3');
        DTMFToneDial6.play();
    }
}

function dial7() {
    if(allowDial == true) {
        numberDial();
        number=number+"7";
        var DTMFToneDial7=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 7.mp3');
        DTMFToneDial7.play();
    }
}

function dial8() {
    if(allowDial == true) {
        numberDial();
        number=number+"8";
        var DTMFToneDial8=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 8.mp3');
        DTMFToneDial8.play();
    }
}

function dial9() {
    if(allowDial == true) {
        numberDial();
        number=number+"9";
        var DTMFToneDial9=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 9.mp3');
        DTMFToneDial9.play();
    }
}

function dialStar() {
    if(allowDial == true) {
        numberDial();
        number=number+"*";
        var DTMFToneDialStar=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial Star.mp3');
        DTMFToneDialStar.play();
    }
}

function dial0() {
    if(allowDial == true) {
        numberDial();
        number=number+"0";
        var DTMFToneDial0=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial 0.mp3');
        DTMFToneDial0.play();
    }
}

function dialPound(){
    if(allowDial == true) {
        numberDial();
        number=number+"#";
        var DTMFToneDialPound=new Audio('DTMF%20Tone%20Dials/DTMF Tone Dial Pound.mp3');
        DTMFToneDialPound.play();
    }
}

//this is missing a closing bracket for the function itself at the end
document.onkeydown = function (event) {
    switch (event.keycode) {
        case 13:
            button.addEventListener('click', function() {
                        toggleLineStatus();
            })
            break;
        case 49,97:
            button.addEventListener('click', function() {
                        dial1();
            })
            break;
        case 50,98:
            button.addEventListener('click', function() {
                        dial2();
            })
            break;
        case 51,99:
            button.addEventListener('click', function() {
                        dial3();
            })
            break;
        case 52,100:
            button.addEventListener('click', function() {
                        dial4();
            })
            break;
        case 53,101:
            button.addEventListener('click', function() {
                        dial5();
            })
            break;
        case 54,102:
            button.addEventListener('click', function() {
                        dial6();
            })
            break;
        case 55,103:
            button.addEventListener('click', function() {
                        dial7();
            })
            break;
        case 56,104:
            button.addEventListener('click', function() {
                        dial8();
            })
            break;
        case 57,105:
            button.addEventListener('click', function() {
                        dial9();
            })
            break;
        case 106:
            button.addEventListener('click', function() {
                        dialStar();
            })
            break;
        case 48,96:
            button.addEventListener('click', function() {
                        dial0();
            })
            break;
        case 109:
            button.addEventListener('click', function() {
                        dialPound();
            })
            break;
}
}

//this function is missing a closing bracket for the function itself at the end
function ring() {
    ringingTone.play();
    timesRung++;
    if(timesRung>1) {
        setTimeout(response,700);
    }
    }

function dial(){
    allowDial=false;
    ring();
    setTimeout(ring,4000);
}


function busy() {
    busyTone();
    }

function busyTone() {
    var pickupBusy=new Audio('Call%20Progress%20Tones/Busy%20Tone/USA%20Busy%20Tone.mp3');
    pickupBusy.play();
    pickupBusy.currentTime=0;
    setInterval(busyTone,4000);
    }
  
function operatorPutCallThrough() {
    operatorPickup.play(true);
}

function response(){
    switch(number) {
        case "0":
            var operatorPickup=new Audio('callResponses/OperatorAnswer.wav');
            operatorPickup.addEventListener("click", function() {
                number=prompt("Operator, your number please? (Numbers only; enter 'police' for police and emergency)");
                if(number==null){
                    number="0";
                }
})
            break;
        case "611":
            var pickup611=new Audio('callResponses/611.wav');
            pickup611.addEventListener("click", function(){
                timeoutHowler();
                pickup611.play();
            })
            break;
        case "711":
            var pickup711=new Audio('callResponses/tdd-1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup711.addEventListener("click", function() {
                timeoutHowler();
                pickup711.play();
            })
            break;
        case "811":
            var pickup811=new Audio('callResponses/811.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup811.addEventListener("click", function() {
                timeoutHowler();
                pickup811.play();
            })
            break;
        case "911":
            var pickup911=new Audio('callResponses/911-xxx-fleet.mp3');
            pickup911.addEventListener("click", function() {
                timeoutHowler();
                pickup911.play();
            })
            break;
        case "18477651008":
            var pickupMCI=new Audio('callResponses/MCI.wav');
            pickupMCI.addEventListener("click", function() {
                timeoutHowler();
                pickupMCI.play();
            })
            break;
        case "8675309":
            var pickup8675309=new Audio('callResponses/discoornis-bell-f1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup8675309.addEventListener("click", function () {
                timeoutHowler();
                pickup8675309.play();
            })
            break;
        case "12124561414":
            var pickup12124561414=new Audio('callResponses/discoornis-bell-f1.mp3');
            pickup12124561414.addEventListener("click", function() {
                busy();
                pickup12124561414.play();
            })
            break;
        case "5551212":
            var pickup5551212=new Audio('callResponses/Dirassist-bell-f1.mp3');
            pickup5551212.addEventListener("click", function() {
                busy();
                pickup5551212.play();
            })
            break;
        case "5555555":
            var pickup5555555=new Audio('callResponses/timeout-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickup5555555.addEventListener("click", function() {
                timeoutHowler();
                pickup5555555.play();
            })
            break;
        case "7480900":
            var pickupSelf=new Audio('callResponses/partyline-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupSelf.addEventListener("click", function() {
                busy();
                pickupSelf.play();
            })
            break;
        case "18005820655":
            var pickup18005820655=new Audio('callResponses/discoornis-bell-f1.mp3');
            pickup18005820655.addEventListener("click", function() {
                busy();
                pickup18005820655.play();
            })
            break;
        case "6508950":
            var pickupAM=new Audio('callResponses/answering-machine-1.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupAM.addEventListener("click", function() {
                pickupAM.play();
            })
            break;
        case "6500050":
            var pickupModem=new Audio('modem.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupModem.addEventListener("click", function() {
                pickupModem.play();
            })
            break;
        case "9703920":
            var pickupFax=new Audio('fax-1.mp3');
            pickupFax.addEventListener("click", function() {
                pickupFax.play();
            })
            break;
        case "17147339969":
            var pickup714=new Audio('device-conference.mp3');
            pickup714.addEventListener("click", function() {
                pickup714.play();
            })
            break;
        case "8217147339969":
            var pickup8217147339969=new Audio('device-conference.mp3');
            pickup8217147339969.addEventListener("click", function() {
            pickup8217147339969.play(); //remove the space before the asterisk
            })
            break;
        case "*6717147339969":
            var pickup6717147339969=new Audio('callResponses/reject2-xxx-fleet.mp3');
            pickup6717147339969.addEventListener("click", function() {
                timeoutHowler();
                pickup714block.play();
            })
            break;
        case "*57":
            var randNum57=Math.random()>=0.5;
            if(randNum57) {
                var pickupCallTrace=new Audio('callResponses/trace3-xxx-fleet.mp3');
            }
            else {
                var pickupCallTrace=new Audio('callResponses/trace-xxx-fleet.mp3');
                pickupCallTrace.addEventListener("click", function() {
                    timeoutHowler();
                    pickupCallTrace.play();
                })
}
            break;
        case "*69":
            var pickupStar69=new Audio('callResponses/return-xxx-fleet.mp3');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupStar69.addEventListener("click", function() {
                timeoutHowler();
                pickupStar69.play();
            })
            break;
        case "police":
            var pickupPolice=new Audio('callResponses/policePickup.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            pickupPolice.addEventListener("click", function() {
                timeoutHowler();
                pickupPolice.play();
                var policeComplaint=prompt("Police Department, Sergeant Duffy Speaking.");
                confirm("Really? You say that "+policeComplaint);
})
          var policeHangup=new Audio('callResponses/policeHangup.wav');
            //this function call is missing a closing parenthesis for the function itself at the end, just before the break
            policeHangup.addEventListener("click", function() {
                timeoutHowler();
            })
            break;
        default:
            var pickupDefault;
            if(number.length>7){
                pickupDefault=new Audio('callResponses/ldcircuits-bell-f1.mp3');
            }
            else {
                pickupDefault=new Audio('callResponses/completeordc-xxx-fleet.mp3');
                pickupDefault.addEventListener("click", function() {
                    timeoutHowler();
                    pickupDefault.play();
                })
                }
            break;
    }
}
}
</script>

</BODY>
</HTML>
So the only thing I see wrong here is that you have an extra ">" after the type attribute, on all your audio tags. Please remove it. I am working on a workaround for the other portion.
 
Last edited:
Not sure if this is relevant but in your audio tag for RingingTone you have this filename

Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3

which seems an odd name with the sequence %20702B in it. By contrast your error message shows

Ringing%20Tone/Princ_20Bell%20Ring.mp3

which looks wrong also. Are you sure the filename in the audio tag is ok.
 
Not sure if this is relevant but in your audio tag for RingingTone you have this filename

Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3

which seems an odd name with the sequence %20702B in it. By contrast your error message shows

Ringing%20Tone/Princ_20Bell%20Ring.mp3

which looks wrong also. Are you sure the filename in the audio tag is ok.
The name including the full path when opened by itself in Mozilla Firefox shows up in the address bar as "file:///M:/Documents/Virtual%20Phone/Call%20Progress%20Tones/Ringing%20Tone/Princess%20702B%20Bell%20Ring.mp3". Does that look right?
 
Last edited:

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom