0
When I play the audio . mp3 it works normally, but when it is an audio . wav it even goes down, but when I listen to it from a runtime error. If I go in the directory where this audio is. wav, I can hear it normally, the problem is even only when low. Code that makes the download
$filename = $arquivo;
$path = storage_path('app/ligacoes_snep/'.$filename);
return Response::make(file_get_contents($path), 200, [
'Content-Type' => 'audio/wav',
'Content-Disposition' => 'inline; filename="'.$filename.'"']);
No Content-Type já tried audio/vnd.wave, audio/wav, audio/wave, audio/x-wav.
Note that the content-type will not actually affect the execution, maybe the audio when you uploaded has been damaged.
– Guilherme Nascimento
But then it would be trouble also when I went to hear it right in the directory
– Luiz Gustavo Costa Ceolin
Maybe the path you’ve gone through is wrong, it could be a milkshake or a minuscule in the file name.
– Guilherme Nascimento
Anyway try it this way:
return Response::make(file_get_contents($path), 200, [
 'Content-Type' => 'audio/wav',
 'Content-Transfer-Encoding: binary',
 'Content-Disposition' => 'inline; filename="'.$filename.'"']);
– Guilherme Nascimento
I capture this link on another server and pass to the one of my system, all the time I use the same name variable.. and if it were the cases of . mp3 would give error tbm
– Luiz Gustavo Costa Ceolin
There is no way to affirm anything, it may not even have to do with the format, it may just be your confusion. You can’t know, anyway
content-type
does not influence, the problem must be something else.– Guilherme Nascimento
unsuccessful....
– Luiz Gustavo Costa Ceolin
Isn’t some letter wrong? Please give more details if it’s not difficult to help.
– Guilherme Nascimento
to kill this doubt, I went there on the server where I took the links and took a fixed name and happened the same problem :(
– Luiz Gustavo Costa Ceolin
Fixed? Refers to opening . wav directly via URL (http), without Windows? If it is, it must be an upload error via FTP. Luiz tries this https://answall.com/a/226669/3635
– Guilherme Nascimento
No no, when I say fixed is that in the filename I passed a name of a direct link from there, went on the server gave Ctrl+c and pasted instead of filename. Another thing, the links are in . WAV and not .wav. Could be something with that?
– Luiz Gustavo Costa Ceolin
yes, uppercase and minuscule letter as I said in the first comment can be a problem, because if you put in the URL something like
foo.wav
, but the file name isFoo.Wav
will not open on Linux servers (most websites are linux)– Guilherme Nascimento
I pass the name as it comes, when I search on the other server, I also use . WAV and when I download tbm I use . WAV, my question about . Larger WAV is that in another part of my system I save links . wav and I have no problem downloading, but it is . wav and not .WAV. Tendesse
– Luiz Gustavo Costa Ceolin