Jump to content

Is it possible to play a wav file using php


php1

Recommended Posts

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

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>

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

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.

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...

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  ;)

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.