Collectives on Stack Overflow. Learn more. How to play a mp3 music using php? Ask Question. Asked 9 years, 6 months ago. Active 3 months ago. Viewed 39k times. I've a directory on the site with several musics. What I want is to click on a simple button and listen to one of those musics. Is this possible using php? You want it to play on the server or the client? Add a comment. Active Oldest Votes. Raphael Pineda Raphael Pineda 1 1 gold badge 4 4 silver badges 10 10 bronze badges. It's browser specific and maybe even platform specific whether mp3's can be played.
PeeHaa PeeHaa Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to play a sound, when i click a button or link in a browser, Ask Question. Asked 10 years, 6 months ago. Active 7 years, 11 months ago. Viewed 11k times.
Rajasekar Gunasekaran Rajasekar Gunasekaran 1, 3 3 gold badges 23 23 silver badges 38 38 bronze badges. Add a comment. Active Oldest Votes. While this method will suffice when loading a handful of audio files, it will significantly slow your computer if you want to load a whole bunch of audio files.
So rather than load all of our audio files at once, we can instead load each audio file asynchronously , meaning that we will only grab it from the server when we explicitly ask for it. We want to construct a "GET" request, which simply copies data from the server. Let's start by setting up our AudioContext , as well as a top-level variable to hold the data in the audio file. Now, let's make the "GET" request. The responseType tells the program that we're loading a sound file. The onload function is a callback function that runs once the file has been grabbed from the server.
0コメント