A decentralized music tracking and discovery platform built on AT Protocol 馃幍 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
at feat/pgpull 22 lines 612 B view raw
1import init, { extract_audio_metadata } from "../pkg/raichu"; 2 3export class Metadata { 4 // eslint-disable-next-line @typescript-eslint/no-explicit-any 5 private metadata: any; 6 7 async load(url: string) { 8 const response = await fetch(url); 9 const arrayBuffer = await response.arrayBuffer(); 10 const uint8Array = new Uint8Array(arrayBuffer); 11 12 await init(); // Initialize WASM 13 this.metadata = extract_audio_metadata(uint8Array); 14 console.log(">> Metadata Loaded Successfully"); 15 } 16 17 get_metadata() { 18 return this.metadata ? JSON.parse(this.metadata) : {}; 19 } 20} 21 22export default Metadata;