Add metadata read/write support for Ogg

This commit is contained in:
Vanilagy
2025-09-05 15:39:29 +02:00
parent 6d32de0fb1
commit d3a030c307
11 changed files with 431 additions and 49 deletions
+21
View File
@@ -702,3 +702,24 @@ export const imageMimeTypeToExtension = (mimeType: string) => {
return null;
}
};
export const base64ToBytes = (base64: string) => {
const decoded = atob(base64);
const bytes = new Uint8Array(decoded.length);
for (let i = 0; i < decoded.length; i++) {
bytes[i] = decoded.charCodeAt(i);
}
return bytes;
};
export const bytesToBase64 = (bytes: Uint8Array) => {
let string = '';
for (let i = 0; i < bytes.length; i++) {
string += String.fromCharCode(bytes[i]!);
}
return btoa(string);
};