song->length * $bitRate * 1024) / 8); // header("Content-Length: $bytes"); header('Content-Type: audio/mpeg'); header('Content-Disposition: attachment; filename="'.basename($this->song->path).'"'); $args = [ '-i '.escapeshellarg($this->song->path), '-map 0:0', '-v 0', "-ab {$bitRate}k", '-f mp3', '-', ]; passthru("$ffmpeg ".implode($args, ' ')); } }