RE: [PHP] Converting audio files and display/play in browser
| From: | Timothy J Hitchens | Date: | Fri, 11 Oct 2002 20:08:49 +0000 |
| Subject: | RE: [PHP] Converting audio files and display/play in browser | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119686@lists.php.net to get a copy of this message | ||
Easy...
<?php
header('Content-Type: audio/mpeg');
readfile('xxx.mp3');
?>
What this does it sends a header then the file is read from disk to
standard out.
Please note you may need to get your include/paths correct...
Timothy Hitchens (HITCHO)
tim@hitcho.com.au
HITCHO has Spoken!
-----Original Message-----
From: Thomas Nilsen [mailto:thomas.nilsen@doc-s.co.uk]
Sent: Saturday, 12 October 2002 6:05 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Converting audio files and display/play in browser
It's the part sending the header back to the browser with the correct
info I'm not sure about. I can handle the conversion of the audio file,
but I'm not sure how to get the browser to read the converted file once
it's ready.
"Timothy J Hitchens" <tim@hitcho.com.au> wrote in message
news:005301c27159$483dc170$0500a8c0@BAMBINO...
> Why don't you call your converter then pipe out to a file... the then
> send headers for that type of file and readfile to the browser..
>
>
> Timothy Hitchens (HITCHO)
> tim@hitcho.com.au
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Thomas Nilsen [mailto:thomas.nilsen@doc-s.co.uk]
> Sent: Saturday, 12 October 2002 4:22 AM
> To: php-general@lists.php.net
> Subject: [PHP] Converting audio files and display/play in browser
>
>
> Anyone got any ideas as to how I can solve the following in PHP?
>
> I want to be able to select a file, and convert it from sox format to
> MP3 or WAV, and then play it in the requestors browser? Can this be
> achieved in an easy way?
>
> The problem I have is to be able to call up lame/sox or similar tools
> on the linux web server, and once the newly converted file is
> available, throw it at the requesting browser as a file download?
>
> Regards, Thomas
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php