Comments (2)
Yep, the library does indeed support popularimeter frames! The docs for the frame is here but that probably doesn't tell you too much about how to use it. Same as TagLib#, the PopularimeterFrame
isn't exposed via the standardized Tag
interface, so you'll have to manipulate the frames directly. When you get to manipulating the frames directly, it can be a bit confusing. Here's an example:
import {
File,
Id3v2Tag,
Id3v2FrameClassType,
Id3v2FrameIdentifiers,
Id3v2PopularimeterFrame,
TagTypes
} from "node-taglib-sharp";
const myFile = File.createFromPath("myFile.mp3");
const id3v2Tag = <Id3v2Tag>myFile.getTag(TagTypes.Id3v2, true);
// Read a popularimeter frame
const popularimeterFrames = id3v2Tag.getFramesByClassType<Id3v2PopularimeterFrame>(Id3v2FrameClassType.PopularimeterFrame);
console.log(popularimeterFrames[0].playCount);
console.log(popularimeterFrames[0].rating);
// Write a popularimeter frame directly
popularimeterFrames[0].user = "[email protected]"; // ID3v2 Spec says it should be an email
popularimeterFrames[0].playCount = 10n; // It's a BigInt
popularimeterFrames[0].rating = 100; // It's a byte between 0 and 255
myFile.save();
// Write a new frame instead
const newPopularmieterFrame = Id3v2PopularimeterFrame.fromUser("abc@123");
newPopularmieterFrame.playCount = 10n;
newPopularmieterFrame.rating = 100;
id3v2Tag.removeFrames(Id3v2FrameIdentifiers.POPM);
id3v2Tag.addFrame(newPopularmieterFrame);
myFile.save();
Let me know if you have any questions or need clarification!
from node-taglib-sharp.
Thanks a lot for taking the time to help out! That's an amazing example. I should be able to get it working with this info.
from node-taglib-sharp.
Related Issues (20)
- Version 5.2.3 breaks reading of mp3 picture.data for some files HOT 4
- bitrate will be 0 on some files HOT 2
- Error setting tags for m4a files HOT 26
- Data Retrieval issues HOT 1
- Argument invalid: Encryption and compression are not supported
- use in browser HOT 5
- Matroska tag docs didn't get generated HOT 1
- Question - error setting title HOT 2
- Question - Setting the text information frames in a id3v2TextInformationFrame HOT 2
- Id3v2FrameIdentifier doc and possible bug ? HOT 4
- Named export not found HOT 4
- Pictures cannot display in windows file browser. HOT 4
- ID3v2 tags at end of file not showing up in players
- Throwing error: `Argument null: ${name} was not provided` HOT 10
- 'Cannot set property ByteVector' error on load of module HOT 3
- id3v2 frameId RGAD causes failure to read tags HOT 4
- Add Legacy ReplayGain Frame Support
- Why Tag class has no accessor for 'artist' ? HOT 1
- poor performance when saving picture HOT 3
- wrong duration of `.mp3` and `.wav` HOT 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 node-taglib-sharp.