Go Back   Tech Support Forum > Design Forum > Web Serving and Management

User Tag List

Play sound on server when the page is accessed

This is a discussion on Play sound on server when the page is accessed within the Web Serving and Management forums, part of the Tech Support Forum category. Greetings friends. I'm trying to do weird experiment but don't know where to start from. I'm using debian linux and


Closed Thread
 
Thread Tools Search this Thread
Old 06-25-2015, 02:34 AM   #1
Registered Member
 
volarepa's Avatar
 
Join Date: Dec 2006
Posts: 3
OS: xp



Greetings friends.
I'm trying to do weird experiment but don't know where to start from.
I'm using debian linux and the webserver is apache.
I have created a webpage Example Domain
Is it possible to play a sound in the server computer when somebody access the page. A helping guidance is most welcome
Thanks
Volarepa
volarepa is offline  
Sponsored Links
Advertisement
 
Old 01-07-2016, 02:51 PM   #2
TSF Enthusiast
 
BrentC's Avatar
 
Join Date: May 2007
Posts: 1,115
OS: Vista Home Premium



You can implement the following code to play audio on your page:

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>

mp3 files run on all browsers, whereas others don't. If you have a program that converts audio files to mp3 than use it.
BrentC is offline  
Old 01-07-2016, 04:50 PM   #3
TSF Enthusiast
 
BrentC's Avatar
 
Join Date: May 2007
Posts: 1,115
OS: Vista Home Premium



After checking on the web there are sites which will do the conversion to mp3 for you.
BrentC is offline  
Sponsored Links
Advertisement
 
Old 01-25-2016, 02:10 PM   #4
TSF Enthusiast
 
BrentC's Avatar
 
Join Date: May 2007
Posts: 1,115
OS: Vista Home Premium



Sorry about that link. I tried it again and it isn't what you want.

Google audio converters for Linux. There are lots of sites for that.
BrentC is offline  
Old 02-04-2016, 03:18 PM   #5
TSF Enthusiast
 
BrentC's Avatar
 
Join Date: May 2007
Posts: 1,115
OS: Vista Home Premium



I'm back...the way to play music when you open a page is as follows:

HTML Code:
<!DOCTYPE html>
<html>
<body onload="playAudio()">

<audio id="myAudio" loop controls>
  <source src="sound.mp3" type="audio/mp3">
  Your browser does not support the audio element.
</audio>


<script>
var x = document.getElementById("myAudio"); 

function playAudio() { 
    x.play(); 
} 

</script>

</body>
</html>
This has an endless loop and controls so take loop and controls out of the <audio> tag if you don't want them.
BrentC is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
No System/Flash Sound
Hello everyone. I'm new to here, so please do advise if I miss anything. I'm currently facing problem after my PC crash earlier. There is no problem with the sound before the crash, so its definitely due to crash that cause the lost of system and flash sound. My system specs are listed...
CircleOfLife Windows XP Support 1 10-12-2011 03:03 PM
XP freezes on lauching a program
Hi. Been having a sudden problem with my ageing Dell desktop. It runs XP SP2, and is a little slow and clunky, but does the job: I hadn't had a crash for something like six months before this occurred. I came into the room and found that the machine had restarted itself. I logged in, and waited...
George_H Windows XP Support 24 03-14-2011 11:24 AM
Access to Internet lost
Hi guys, I'm working on a home network where quite regularly the internet connection drops and requires the router to be restarted. I know this is something that can happen from time to time but this is happening every few days. For this reason we swapped the modem/router for a new one to see if...
PaoloPanella Modems/Cable/DSL/Satellite 9 03-11-2011 05:55 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 03:49 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts