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

No duration in metadata.format when using parseBuffer #2001

Closed
2 tasks done
egeste opened this issue Feb 8, 2024 · 1 comment
Closed
2 tasks done

No duration in metadata.format when using parseBuffer #2001

egeste opened this issue Feb 8, 2024 · 1 comment
Labels
bug Bug, will addressed with high priority caused by corrupt audio track

Comments

@egeste
Copy link

egeste commented Feb 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

music-metadata version

7.14.0

JavaScript module eco system

ECMAScript modules (ESM), music-medata ≥ version 8

Current Behavior

Given the provided file, I never receive duration in the format output

const fs = require('node:fs')
const path = require('node:path')
const mm = require('music-metadata')

;(async () => {
  const filePath = path.resolve(__dirname, 'test-123.mp3')
  const fileBuffer = fs.readFileSync(filePath)
  const attrs = { mimeType: 'audio/mpeg'}
  const options = { duration: true, skipCovers: true, skipPostHeaders: true }
  console.log((await mm.parseFile(filePath, attrs, options)).format)
  console.log((await mm.parseBuffer(fileBuffer, attrs, options)).format)
})()
{
  tagTypes: [],
  trackInfo: [],
  lossless: false,
  container: 'MPEG',
  codec: 'MPEG 2.5 Layer 1',
  sampleRate: 11025,
  numberOfChannels: 1,
  bitrate: 112000
}
{
  tagTypes: [],
  trackInfo: [],
  lossless: false,
  container: 'ADTS/MPEG-4',
  codec: 'AAC',
  sampleRate: undefined,
  numberOfChannels: 2,
  bitrate: NaN
}

I also note that it's odd that parseBuffer and parseFile return different outputs for the same file.

Expected Behavior

I expect metadata.format.duration to contain the duration of the audio

Attached audio sample?

  • I have provided sufficient information to reproduce the

test-123.zip

@egeste egeste added the bug Bug, will addressed with high priority label Feb 8, 2024
@Borewit
Copy link
Owner

Borewit commented Mar 18, 2024

MP3 file is corrupt, I cannot play it with foobar2000.

@Borewit Borewit closed this as completed Mar 18, 2024
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 caused by corrupt audio track
Projects
None yet
Development

No branches or pull requests

2 participants