", ":", "\"", "\\", "|", "?", "*"], "-", $song["artist"] . " - " . $song["title"]); function getSize($bytes) { if ($bytes < 1024) { return $bytes; } if ($bytes < 1024**2) { return round($bytes / 1024, 1) . " KB"; } if ($bytes < 1024**3) { return round($bytes / 1024**2, 1) . " MB"; } return round($bytes / 1024**3, 1) . " GB"; } function timeToDuration($seconds) { $hours = floor($seconds / 3600); $minutes = floor($seconds / 60) - ($hours * 60); $seconds = floor($seconds) - ($hours * 3600) - ($minutes * 60); $parts = []; if ($hours > 0) $parts[] = $hours . " hour" . ($hours > 1 ? "s" : ""); if ($minutes > 0) $parts[] = $minutes . " minute" . ($minutes > 1 ? "s" : ""); if ($seconds > 0) $parts[] = $seconds . " second" . ($seconds > 1 ? "s" : ""); return implode(", ", $parts); } function getBitRate($bits) { $bitsValue = $bits . " bps"; if ($bits > 1000) { if ($bits > 1000000) { if ($bits > 1000000000) { $bitsValue = round($bits / 1000000000, 2) . " Gbps"; } else { $bitsValue = round($bits / 1000000, 2) . " Mbps"; } } else { $bitsValue = round($bits / 1000, 2) . " kbps"; } } $bytesValue = ($bits / 8) . " B/s"; if (($bits / 8) > 1000) { if (($bits / 8) > 1000000) { if (($bits / 8) > 1000000000) { $bytesValue = round(($bits / 8) / 1000000000, 2) . " GB/s"; } else { $bytesValue = round(($bits / 8) / 1000000, 2) . " MB/s"; } } else { $bytesValue = round(($bits / 8) / 1000, 2) . " kB/s"; } } return $bitsValue . " (" . $bytesValue . ")"; } function getChannelConfiguration($c) { if ($c === 1) return " (Mono)"; if ($c === 2) return " (Stereo)"; if ($c === 3) return " (Stereo+1)"; if ($c === 4) return " (3.1)"; if ($c === 5) return " (4.1 or 5.0 Surround)"; if ($c === 6) return " (5.1 Surround)"; if ($c === 7) return " (6.1 or 7.0 Surround)"; if ($c === 8) return " (7.1 Surround)"; if ($c === 9) return " (9.0 or 7.2 Spatial Audio)"; if ($c === 10) return " (9.1 Spatial Audio)"; if ($c >= 11) return " (Dolby Atmos)"; return ""; } ?>
Track | Disc = $song["disc"] ?>, track = $song["track"] > 0 ? $song["track"] : "-" ?> |
Duration | = timeToDuration($song["length"]) ?> |
Bit rate | = getBitRate($song["bitRate"]) ?> |
Sample rate | = $song["sampleRate"] ?> Hz |
Bits per sample | = $song["bitDepth"] ?> bits |
Channels | = $song["channels"] ?>= getChannelConfiguration($song["channels"]) ?> |
Year | = $song["date"] ?> |
High-resolution | = $song["hiRes"] ? "Yes" : "No" ?> |
Mist Stella | Yes (#= $metadata["id"] ?>, Version = $metadata["version"] ?>) No |
Copyright | = trim($song["copyright"] ?? "") !== "" ? $song["copyright"] : "-" ?> |
File size (lossless) | = getSize(filesize($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".flac")) ?> |
File size (AAC-LC) | = getSize(filesize($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".m4a")) ?> |
File size (Stella) | = getSize(filesize($_SERVER['DOCUMENT_ROOT'] . "/assets/content/" . $_GET["i"] . ".stella")) ?> - |