Comments (11)
This is probably pushing the boundaries of the potential use cases for this library slightly. Let's leave it out for now, good idea though 👍
from musicmetadata.
okay. To be clear, this isn't just a random API idea that I had. This must be done somewhere for my music player app to recognize which files to put in the library. So I'll either have to maintain a fork or have a library that sits in front of musicmetadata.
from musicmetadata.
Really what I need is the ability to distinguish between audio files that have no metadata tags, and non-audio-files.
from musicmetadata.
Could you not use this?: https://github.com/broofa/node-mime
from musicmetadata.
file extension based? I don't see why I'd even bother to translate the extension into a mime type then. I could just have a set of acceptable file extensions.
But guessing based on extension is not quite as robust as actually checking the metadata header.
musicmetadata contains useful logic for determining the content type of a stream - why not expose it?
from musicmetadata.
Lets say you have 100,000 files on your computer.
Having to read some data from every single one of those files just to find out its mime type would take forever.
from musicmetadata.
If I have 100,000 files on my computer, all the more reason I need to build an index of artist/album/title etc for the music library. To build an index I need to read some data from each file, including the metadata. To even read the metadata, I have to learn the file type. The work will be done regardless.
from musicmetadata.
Lets say only 1000 of those files are audio files, all mp3s.
You could do two things:
Read the first n bytes of every file to detect the mime type. This involves opening a file descriptor, numerous sys calls, never mind actually having to read bits from the disk.
Or you could just filter on the file extension.
from musicmetadata.
okay I see why we have different mindsets: Your use case is scanning your entire hard drive; my use case is scanning, for example, /home/andy/music
I still think this principle holds true: if a module/library calculates or learns something nontrivially useful in the course of doing its main task, that information should be exposed. Otherwise API consumers will try to duplicate (poorly) the functionality, yet depending on the 2 different codebases to do the same thing.
Are you mandating that this module keep secret which decoder it ended up using on the stream?
from musicmetadata.
I just don't see the value proposition for this feature, sorry.
Either the library will emit a metadata
event or it wont.
from musicmetadata.
For reference, here's what this looks like: https://github.com/superjoe30/node-musicmetadata/commit/7f922555d386d5f39c741640694a639e6f45cf63
from musicmetadata.
Related Issues (20)
- 'Could not find metadata header' with some mp3s HOT 5
- No metadata in file that has metadata HOT 2
- Webpack, fs and HTML 5 File object HOT 1
- Misleading examples: the Readable Stream should be closed HOT 3
- error when extract image HOT 3
- Error: expected frame header but was not found. FLAC files parsed with id3v2 parser? HOT 2
- Dump complete metadata? HOT 1
- Rating tag support HOT 3
- Chapter Addendum? HOT 1
- Warning: Possible EventEmitter memory leak detected. HOT 1
- [Question] Is there a way to not parse / load the picture buffer HOT 3
- Chrome freezes/locks up while loading FLAC metadata from arraybuffer HOT 2
- Completion callback invoked twice HOT 1
- Callback is never called HOT 4
- Webpack with electron-renderer target imports non-browser-wrapped version
- using file upload control HOT 1
- Doesn't support OGG. HOT 2
- Do not provide duration of audio HOT 5
- File's picture
- Metadata output doesn't include composer tag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from musicmetadata.