Borewit / music-metadata

Stream and file based music metadata parser for node. Supporting a wide range of audio and tag formats.
MIT License
972 stars 93 forks source link

readme error: metadata.common.picture return that is array #2170

Closed pointchange closed 3 months ago

pointchange commented 3 months ago

Is there an existing issue for this?

music-metadata version

No response

JavaScript module eco system

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

Current Behavior

my data:

[ { format: 'image/jpeg', type: 'Media (e.g. label side of CD)', description: '', data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff db 00 43 00 02 01 01 01 01 01 02 01 01 01 02 02 02 02 02 04 03 02 02 02 02 05 04 04 03 ... 221375 more bytes> } ]

In your README.md, error: 微信图片_20240724172419

In my project, I think it can be right : data:${picture[0].format};base64,${picture[0].data.toString('base64')}

Expected Behavior

No response

Attached audio sample?

Borewit commented 3 months ago

The examples are outdated. Since Buffer (picture.data) has been replaced with UInt8Array the toString('base64') no longer works.