GithubHelp home page GithubHelp logo

claucambra / flacmetadatakit Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.95 MB

A package to parse FLAC files' metadata, locally or remotely

License: GNU Lesser General Public License v3.0

Swift 100.00%
flac music streaming swift swift-package-manager

flacmetadatakit's Introduction

FLACMetadataKit

FLACMetadataKit is a Swift library designed to parse metadata from FLAC audio files either locally or streamed from the internet. It is able to extract information such as stream info, Vorbis comments, picture data, and other relevant metadata in a progressive and efficient manner.

Features

  • Local Parsing: Parse FLAC metadata directly from local files.
  • Streaming Parsing: Fetch and parse metadata progressively from remote FLAC files without needing to download the entire file.
  • Support for Multiple Metadata Types: Handles various types of metadata including StreamInfo, Vorbis Comments, Cue Sheets, Pictures, and more.
  • Error Handling: Handles parsing issues like incomplete data or non-FLAC content.

Installation

Swift Package Manager

You can add FLACMetadataKit to your project via Swift Package Manager.

Usage

Parsing Local FLAC Files

import FLACMetadataKit

let flacData = Data(contentsOf: URL(fileURLWithPath: "path/to/your/file.flac"))
let parser = FLACParser(data: flacData)

do {
    let metadata = try parser.parse()
    print("Parsed metadata successfully: \(metadata)")
} catch {
    print("Error parsing FLAC metadata: \(error)")
}

Streaming FLAC Metadata from the Internet

import FLACMetadataKit
import Alamofire

let url = URL(string: "http://example.com/file.flac")!
let session = Alamofire.Session.default
let fetcher = FLACRemoteMetadataFetcher(url: url, session: session, headers: nil)

Task {
    if let metadata = await fetcher.fetch() {
        print("Successfully fetched and parsed metadata: \(metadata)")
    } else {
        print("Failed to fetch metadata.")
    }
}

Contributing

Contributions to FLACMetadataKit are welcome! Here's how you can contribute:

  • Issues: Submit issues for bugs, enhancements, or features via GitHub Issues.
  • Pull Requests: We welcome pull requests. Please fork the repository and submit a PR for review.

License

FLACMetadataKit is released under the LGPL V3 License. See the LICENSE file for more information.

flacmetadatakit's People

Contributors

claucambra avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

misaki1301

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.