Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata.parseBuffer is not a function #2319

Closed
1 of 2 tasks
dragonhub0710 opened this issue Jan 6, 2025 · 1 comment
Closed
1 of 2 tasks

metadata.parseBuffer is not a function #2319

dragonhub0710 opened this issue Jan 6, 2025 · 1 comment
Labels
bug Bug, will addressed with high priority

Comments

@dragonhub0710
Copy link

dragonhub0710 commented Jan 6, 2025

Is there an existing issue for this?

  • I have searched the existing issues

music-metadata version

v10.6.4

Current Behavior

const metadata = require("music-metadata");

const audioStream = await client.generate({ ... });

let chunks = [];
for await (const chunk of audioStream) {
  chunks.push(chunk);
}
// Concatenate all chunks into a single Uint8Array
const audioBuffer = Buffer.concat(chunks);

metadata.parseBuffer(audioBuffer, { mimeType: "audio/mpeg" })
  .then((metadata) => {
    console.log({ metadata });
  })
  .catch((err) => {
    console.error(err);
  });

This is the current code in Node.js
Now I have error like:
metadata.parseBuffer is not a function

Expected Behavior

I want to get some metadata like sampleRate, bitDepth, channels from audio stream data in Node.js

Attached audio sample?

  • I have provided sufficient information to reproduce the issue
@dragonhub0710 dragonhub0710 added the bug Bug, will addressed with high priority label Jan 6, 2025
@Borewit
Copy link
Owner

Borewit commented Jan 6, 2025

Please check the CommonJS backward compatibility guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, will addressed with high priority
Projects
None yet
Development

No branches or pull requests

2 participants