A decentralized music tracking and discovery platform built on AT Protocol 🎵 forked from rocksky.app/rocksky
Something went wrong. Try again.
1234567891011121314151617181920212223import init, { extract_audio_metadata } from "../pkg/raichu";
export class Metadata { // eslint-disable-next-line @typescript-eslint/no-explicit-any private metadata: any;
async load(url: string) { const response = await fetch(url); const arrayBuffer = await response.arrayBuffer(); const uint8Array = new Uint8Array(arrayBuffer);
await init(); // Initialize WASM this.metadata = extract_audio_metadata(uint8Array); console.log(">> Metadata Loaded Successfully"); }
get_metadata() { return this.metadata ? JSON.parse(this.metadata) : {}; }}
export default Metadata;