Comments (8)
Does it happen for any file? If so, can you provide some sample file?
This library is used in https://github.com/nazar-pc/CleverStyle-Music and I never seen this happening.
from metadata-audio-parser.
Same here, got the same file in "picture" property, for all files tested.
But i'm not sure if i use it correctly, Can you provide some exemple ?
Thanks
from metadata-audio-parser.
Here is an example in CoffeeScript in mentioned project: https://github.com/nazar-pc/CleverStyle-Music/blob/master/html/cs-music-player/script.coffee#L229
Better show your example so that I can suggest something.
from metadata-audio-parser.
Thanks for your reply,
Here is how i use it, i work on a ionic project, and browse audio file across an android device, for each audio file, i fetch some data, the parser work very well and fast, but "picture" return the same File object.
`getFile: function (fileEntry) {
var deferred = $q.defer();
fileEntry.file(function(file) {
if ( file.type !== null && file.type.indexOf('audio') < 0 ) return deferred.resolve(false);
// Create media object
var media = new Media(fileEntry.fullPath);
// Get meta and stuff
parse_audio_metadata(file, function (tag) {
console.log(tag);
var result = {
coverUrl: tag.picture ? tag.picture.localURL : false,
description: '',
id: media.id,
provider: 'device',
score: '',
title: tag.title,
artist: tag.artist,
album: tag.album,
genre: tag.genre,
url: file.fullPath,
media: media,
};
deferred.resolve(result);
}, function parseError(error) {
console.log(error);
deferred.resolve(false);
})
})
return deferred.promise;
},
`
See attach for the log of 'tag' response
from metadata-audio-parser.
Did you try to show that image on screen?
Because it is actually taken from that file, I think this might be a reason why you got such result. Also compare size
of picture with size
of source file whether they differ anyhow.
It should be fine, since other tags were extracted properly.
from metadata-audio-parser.
Thanks again, the size of File and Picture are the same, start and end looks good.
But how can you display an image with that kind of blob ?
from metadata-audio-parser.
url = URL.createObjectURL(metadata.picture)
and you'll get something you can use as URL to add it on the page. Also if you work with multiple such objects do not forget to call URL.revokeObjectURL(url)
afterwards to avoid memory leaks.
from metadata-audio-parser.
It fail too with message :
Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
I think something dont work with the Cordova File Plugin, i'll try to find a solution.
from metadata-audio-parser.
Related Issues (1)
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 metadata-audio-parser.