php1 Posted August 26, 2008 Share Posted August 26, 2008 dear all , I have to play a wav file , but do not download that file ( as in you tube and all). It will play the file for the user but do not download the file in users machine. is it possible through? php Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/ Share on other sites More sharing options...
JasonLewis Posted August 26, 2008 Share Posted August 26, 2008 Wouldn't think so, since PHP is server-side, not client side. Hmmm.. Try searching Google for playing audio through a web-browser. Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625836 Share on other sites More sharing options...
gaza165 Posted August 26, 2008 Share Posted August 26, 2008 I have recently made a blog that is able to search for YouTube urls such as http://www.youtube.com/watch?v=Smeyf8nhM5Q and embed it into the page and load the video? Would this be of any use to you? Gaza Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625846 Share on other sites More sharing options...
php1 Posted August 26, 2008 Author Share Posted August 26, 2008 is it possible to embed the youtube url to play my wav files. If possible would you please explain to me how can we achieve that. I am new to php. thank u for all of your responses Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625850 Share on other sites More sharing options...
gaza165 Posted August 26, 2008 Share Posted August 26, 2008 Well currently i am getting my youtube urls from a database.... where would you plan on getting your links from? Would it be just a basic link sitting in your html like http://www.blablah.com/audio.wav then users click that and goes to a page where it will load?? Or would u be retrieving the link from a database. Gaza Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625853 Share on other sites More sharing options...
pambo Posted August 26, 2008 Share Posted August 26, 2008 hi... im not sure i quite understand the problem..... but if u want to play music in the background u could try this code here :S <script language="javascript" type="text/javascript"> var musicsrc="yourAudioFileHERE.wav" if (navigator.appName=="Microsoft Internet Explorer") document.write('<bgsound src='+'"'+musicsrc+'"'+' loop="infinite">') else document.write('<embed src=\"'+musicsrc+'\" hidden="true" border="0" width="20" height="20" autostart="true" loop="true">') //--> </script> Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625857 Share on other sites More sharing options...
kenrbnsn Posted August 26, 2008 Share Posted August 26, 2008 That looks like Javascript, the OP asked for something in PHP. Ken Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625860 Share on other sites More sharing options...
gaza165 Posted August 26, 2008 Share Posted August 26, 2008 It really depends on where the wav file is coming from, is it external or internal?? <? $link = "http://www.dailywav.com/0808/85calories.wav"; $video = "<embed src='".$link."'>"; echo $video; ?> this is a simple code in php that gets an external wav from a website and plays it in the browser. but this is really dependednt on where the wav link is coming from Gaza Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625862 Share on other sites More sharing options...
php1 Posted August 26, 2008 Author Share Posted August 26, 2008 my .wav file and my php file is stored in the same directory. php file in : /var/www/html/playfiles/test.php wav file in : /var/www/html/playfiles/samplefiles/play.wav if i use embed then it first ask for download and then only i can hear the sound. But I have to play the wav file only. do not download the file to tthe users system. if the user wish he can hear the sound inwav file. but he has no permission to download and have the file in his system. I can also use java script in my php. Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625872 Share on other sites More sharing options...
JasonLewis Posted August 26, 2008 Share Posted August 26, 2008 Try using object instead of embed. <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <param name="AutoStart" value="1" /> <param name="FileName" value="filename.wav" /> </object> Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625875 Share on other sites More sharing options...
php1 Posted August 26, 2008 Author Share Posted August 26, 2008 i tried this code but it is not working <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <param name="AutoStart" value="1" /> <param name="FileName" value="samplefiles/play.wav" /> </object> Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625881 Share on other sites More sharing options...
Mchl Posted August 26, 2008 Share Posted August 26, 2008 I have to play a wav file , but do not download that file ( as in you tube and all). It will play the file for the user but do not download the file in users machine. is it possible through? php The only option I see here, is to use some kind of flash-built media player... Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625885 Share on other sites More sharing options...
aschk Posted August 26, 2008 Share Posted August 26, 2008 What you're asking is essentially to stream music from the server to the client interface, unfortunately because the html markup doesn't facilitate this (to my knowledge) you need to work with a front-end client such as flash, as you need an interactive end that will interpret the music stream. I will have a look into it but in short, I don't believe browsers can stream music (for hearing) direct to the users ears Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-625907 Share on other sites More sharing options...
php1 Posted August 27, 2008 Author Share Posted August 27, 2008 whether anybody tell some idea on how to use flash player to hear music Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-626714 Share on other sites More sharing options...
php1 Posted August 29, 2008 Author Share Posted August 29, 2008 using flash-builtin player how can we play muisc. would you please explian something on that Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-628552 Share on other sites More sharing options...
Mchl Posted August 29, 2008 Share Posted August 29, 2008 I'm not a flash expert, but I can imagine you have to create a flash animation with embedded wav file. Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-628558 Share on other sites More sharing options...
php1 Posted August 29, 2008 Author Share Posted August 29, 2008 i did'nt understand the logic to implement it fully. can u please explain on it some more. what i understand ids that i have to install some media player in my webrowser and use some components of it to hear the music. is it in that way or any other way Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-628561 Share on other sites More sharing options...
Mchl Posted August 29, 2008 Share Posted August 29, 2008 You understood wrong. You need to get some Flash authoring software, and use it to create a flash file, that will play music when 'displayed' in user's browser. I'm afraid I can't give you more details than this. Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-628563 Share on other sites More sharing options...
php1 Posted August 29, 2008 Author Share Posted August 29, 2008 thank u so much for your reply Link to comment https://forums.phpfreaks.com/topic/121384-is-it-possible-to-play-a-wav-file-using-php/#findComment-628564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.