Answer the question
In order to leave comments, you need to log in
How to give wav correctly?
Good day.
Today the task has become to give wav files from under ssh connection.
It seems that everything is in order, the record is played, but rewind and playback progress do not work.
function openFile($remote_dir, $remote_file) {
$sftp = $this->sftp;
$dir = "ssh2.sftp://$sftp$remote_dir$remote_file";
$stream = readfile("$dir", 'r');
header('Content-Type: audio/x-wav');
header("Accept-Ranges: bytes");
header("Connection: close");
header("Content-type: application/octet-stream");
header("Content-Length: ".filesize($dir));
header("Content-Range:bytes 0-".filesize($dir)."/".filesize($dir));
die();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question