I want use html5's new tag to play a wav file (currently only supported in FF.)
https://developer.mozilla.org/En/HTML/Element/Audio
I"m using php's readfile command to get the wav file off the hdd, and write it to the http response.
But its not working. The audio widget in firefox just has the loading animation running constantly.
The tag seems to be fine as I can put a different url in it's src/source and it works fine. I can use an tag and that downloads the file and it plays using Quicktime fine.
So I thinking perhaps its one/all of the content headers.
Using the FF Extension httpfox I can see these response headers arrive from the server:
(Status-Line) HTTP/1.1 200 OK
Date Mon, 12 Oct 2009 03:04:33 GMT
Server securesauce
Cache-Control private
Expires Mon, 26 Jul 1997 05:00:00 GMT
Pragma private
Vary Accept-Encoding
Content-Encoding gzip
Content-Length 8217
Keep-Alive timeout=15, max=100
Connection Keep-Alive
Content-Type audio/x-wav
So everything looks how I'd expect it to. The only headers I'm explicitly setting in the script (others are set elsewhere in the app) are:
Cache-Control private
Pragma private
Content-Type audio/x-wav
When I tried a different wav file (random one off the internet) httpfox didn't list any response headers.
Because its a php file sending out the content, I can't just send no headers, as I'd have to at least send the content-type.
Any ideas?
Source excerpt:
header('Cache-Control: private');
header('Pragma: private');
header("Content-Type: $contentType");
readfile($filepath);
exit;