https://github.com/nbonamy/taglib_ffi
https://github.com/nbonamy/taglib_ffi
alac audio audio-classification dart flac flac-tags flutter m4a m4a-tags metadata mp3 mp3-tags mp4 taglib tags
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nbonamy/taglib_ffi
- Owner: nbonamy
- License: mit
- Created: 2023-04-07T14:27:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T01:35:22.000Z (about 2 years ago)
- Last Synced: 2025-01-13T20:27:30.303Z (5 months ago)
- Topics: alac, audio, audio-classification, dart, flac, flac-tags, flutter, m4a, m4a-tags, metadata, mp3, mp3-tags, mp4, taglib, tags
- Language: C++
- Homepage:
- Size: 1010 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# taglib_ffi
### **Only built/tested on MacOS for now!**
A dart wrapper of TagLib.
Supported formats:
- MP3
- FLAC
- MP4 (aka. M4A, aka. ALAC)Supported fiunctionalities:
- Read/Update/Delete tags (see below)
- Read/Update/Delete artwork
- Read/Update/Delete lyrics## Dependencies
### MacOS
```shell
brew install cmake
brew install taglib
```## Setup
### MacOS
`HOMEBREW_PREFIX` variable needs to be defined:
```shell
export HOMEBREW_PREFIX="$(brew --prefix)"
```## Usage
Add as a `pubspec.yaml` dependency.
To read/write tags:
```dart
TagLib tagLib = TagLib();
Tags tags = tagLib.getAudioTags(filename);
if (tags.valid) {
...
}
// update tags
tagLib.setAudioTag(filename, tags);
```To display artwork:
```dart
TagLib tagLib = TagLib();
FutureBuilder(
future: tagLib.getArtworkBytes(filename),
builder: (_, snapshot) => Image.memory(snapshot.data)
)
```To read/write lyrics:
```dart
TagLib tagLib = TagLib();
String lyrics = tagLib.getLyrics(filename);
// update lyrics
tagLib.setLyrics(filename, lyrics);
```## Tests
```shell
make tests
```## Supported tags
- Title
- Album
- Artist (Album Artist)
- Performer
- Composer
- Genre
- Copyright
- Comment
- Year
- Compilation
- Volume/Album Index
- Volume/Album Count
- Track Index
- Track Count