Giter Site home page Giter Site logo

realth000 / taglib_ffi Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 7.55 MB

Use TagLib to mange audio metadata tags in dart/flutter.

License: MIT License

Kotlin 2.29% Dart 18.75% CMake 29.33% C++ 39.65% C 4.72% Shell 2.46% Swift 1.23% Ruby 1.57%
audio-metadata dart flutter flutter-package dart-library

taglib_ffi's Introduction

taglib_ffi

Use TagLib to manage audio metadata tags in dart/flutter.

WIP

taglib_ffi is currently work in progress. API may change in the future.

Currently test on Android and Linux.

Usage

import 'package:taglib_ffi_dart/taglib_ffi_dart.dart' as taglib;

final filePath = 'path/to/audio/file';

await taglib.initialize();

final metadata = await taglib.readMetadata(filePath);

For Android platform,

where metadata is:

class Metadata {
  final String? title;
  final String? artist;
  final String? album;
  final String? albumArtist;
  final int? track;
  final int? albumTotalTrack;
  final int? year;
  final String? genre;
  final String? comment;
  final int? sampleRate;
  final int? bitrate;
  final int? channels;
  final int? length;
  final String? lyrics;
  final Uint8List? albumCover;
}

Features

Platform support

  • Android
  • iOS
  • Linux
  • macOS
  • Windows (coming soon)

I don't have Apple device, feel free to PR if you would like to help for this!

Format support

Format Tag Type Read Write
mp3 Id3v2 ✔️
flac Vorbis comment
ape APEv2
wma ASF
dsd/dsf Id3v2
wav RIFF

Tag support

  • Title
  • Artist
  • Album
  • Album artist
  • Track number
  • Album track number
  • Year
  • Genre
  • Comment
  • Sample rate
  • Bitrate
  • Channels
  • Duration
  • Lyrics
  • Album cover image
    • Multiple images with type
  • Custom tags

Install

Add taglib_ffi_dart and taglib_ffi_dart_libs to pubspec.yaml as dependencies.

Use packages hosted on pub:

dependencies:
  taglib_ffi_dart: current_version
  taglib_ffi_dart_libs: current_version

Build from source

All

All platforms should generate the binding dart code first.

dart pub get
dart run ffigen --config ffigen.yaml
  • Set llvm directory in ffigen.yaml if llvm is not found on Windows.
    # For Windows:
    # llvm-path:
    #   - 'D:\PATH\TO\LLVM'
  • Run the following command if system header is not found on Linux.
    • export CPATH="$(clang -v 2>&1 | grep "Selected GCC installation" | rev | cut -d' ' -f1 | rev)/include"
    • See dart-lang issue

Android

# Export env, SDK and NDK are required.
export ANDROID_HOME=/path/to/Android/SDK

cd packages

# Build and save libs
./taglib_ffi_dart/scripts/build_android.sh ./taglib_ffi_dart_libs/android/src/main/jniLibs

After that, libs are automatically bundled with app.

Linux

./taglib_ffi_dart/scripts/build_linux.sh ./taglib_ffi_dart_libs/linux

After that, libs are automatically bundled with app.

Windows

TODO

taglib_ffi's People

Contributors

realth000 avatar

Stargazers

Ferry avatar Maxim Saplin avatar

Watchers

 avatar

taglib_ffi's Issues

对目前 wrapper 完成度的疑问

看了下 src 目录下的 wrapper,好像是只完成了统一的 tag 读取和 id3v2 的细分读取。其他的比如 flac 的 vorbis comment 和 wav 的 riff 读取好像并没有包装。请问有考虑继续完善下去吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.