Play MP3 on Page Load: Easily Learn How

  • Thread starter Thread starter Mk
  • Start date Start date
AI Thread Summary
To create a website that randomly plays a sound file on page load, using PHP is recommended due to its server-side capabilities, which can easily handle a dynamic number of sound files in a directory without requiring constant updates to parameters. JavaScript, particularly AJAX, could also be an option for this functionality, but PHP is generally seen as the simpler and more effective choice for managing file selection. Additionally, it's advised to avoid auto-playing sounds on production websites, as this can negatively impact user experience.
Mk
Messages
2,039
Reaction score
4
I have a website idea that I want to do to learn a little bit more about making web sites. One thing I don't know how to do, is I want the website to be able to randomly pick a sound file out of a directory, and play it on pageload. There will be a changing amount of sound files, so it wouldn't be good if I'd have to change a parameter of how many files there are every time. I don't know if I should be using php, or javascript, or something else. Can anybody help me?
 
Technology news on Phys.org
The easiest way I can think of would be PHP. You might be able to do AJAX (JavaScript), though. But PHP would be best.

And for the love of all that is holy, please don't put auto-playing sounds on an actual production website.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Back
Top