fix: wav format audio, #2317

This commit is contained in:
jialin
2025-07-16 13:06:01 +08:00
parent f4d6abace7
commit 14d60264c7
9 changed files with 68 additions and 24 deletions
+4 -2
View File
@@ -28,12 +28,14 @@ export const convertFileSize = (
): string | number => {
if (!sizeInBytes) return allowEmpty ? '' : 0;
const fmt = 1024;
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
let size = sizeInBytes;
let unitIndex = 0;
while (size >= 1024 && unitIndex < units.length - 1) {
size /= 1024;
while (size >= fmt && unitIndex < units.length - 1) {
size /= fmt;
unitIndex++;
}