MCPcopy Index your code
hub / github.com/Serial-ATA/lofty-rs

github.com/Serial-ATA/lofty-rs @0.24.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.24.0 ↗ · + Follow
2,216 symbols 6,316 edges 252 files 637 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Lofty logo

Lofty

Parse, convert, and write metadata to various audio formats.

GitHub Workflow Status Downloads Version Documentation GitHub Sponsors

⚠️ LOOKING FOR HELP WITH DOCUMENTATION ⚠️

I'm looking for help with the refinement of the docs. Any contribution, whether it be typos, grammar, punctuation, or missing examples is highly appreciated!

Supported Formats

File Format Metadata Format(s)
AAC (ADTS) ID3v2, ID3v1
Ape APE, ID3v2*, ID3v1
AIFF ID3v2, Text Chunks
FLAC Vorbis Comments, ID3v2*
MP3 ID3v2, ID3v1, APE
MP4 iTunes-style ilst
MPC APE, ID3v2*, ID3v1*
Opus Vorbis Comments
Ogg Vorbis Vorbis Comments
Speex Vorbis Comments
WAV ID3v2, RIFF INFO
WavPack APE, ID3v1

* The tag will be read only, due to lack of official support

Examples

To try them out, run:

cargo run --example tag_reader /path/to/file
cargo run --example tag_stripper /path/to/file
cargo run --example tag_writer <options> /path/to/file
cargo run --example custom_resolver

Documentation

Available here

Testing

As some formats are complex, Lofty makes use of test-log to get the detailed debug/trace logging for failures. To run the tests, do:

RUST_LOG=trace cargo test

Benchmarking

There are benchmarks available here. To run them, do:

cargo bench

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

Truncate (Interface)
Provides a method to truncate an object to the specified length This is one component of the [`FileLike`] trait, which [6 …
lofty/src/util/io.rs
Length (Interface)
Provides a method to get the length of a storage object This is one component of the [`FileLike`] trait, which is used [7 …
lofty/src/util/io.rs
SplitTag (Interface)
Split (and merge) tags. Useful and required for implementing lossless read/modify/write round trips. Its counterpart `M [8 …
lofty/src/tag/split_merge_tag.rs
MergeTag (Interface)
The counterpart of [`SplitTag`]. [8 implementers]
lofty/src/tag/split_merge_tag.rs
TagExt (Interface)
A set of common methods between tags This provides a set of methods to make interaction with all tags a similar experie [8 …
lofty/src/tag/tag_ext.rs

Core symbols most depended-on inside this repo

push
called by 236
lofty/src/ogg/tag.rs
read_from
called by 211
lofty/src/probe.rs
iter
called by 125
ogg_pager/src/packets.rs
save_to
called by 107
lofty/src/mp4/write.rs
seek
called by 99
lofty/src/iff/chunk.rs
into
called by 90
lofty/src/id3/v2/frame/header/mod.rs
read_u8
called by 81
lofty/src/mp4/read/atom_reader.rs
insert
called by 76
lofty/src/ogg/tag.rs

Shape

Method 1,018
Function 958
Class 165
Enum 52
Interface 23

Languages

Rust100%

Modules by API surface

lofty/src/mp4/ilst/mod.rs73 symbols
lofty/src/id3/v2/tag/tests.rs73 symbols
lofty/src/id3/v2/tag.rs72 symbols
lofty/tests/taglib/test_id3v2.rs67 symbols
lofty/src/ape/tag/mod.rs66 symbols
lofty/src/tag/mod.rs65 symbols
lofty/src/ogg/tag.rs58 symbols
lofty/src/probe.rs36 symbols
lofty/src/iff/aiff/tag.rs36 symbols
lofty/src/id3/v1/tag.rs36 symbols
lofty/src/picture.rs35 symbols
lofty/src/iff/wav/tag/mod.rs33 symbols

For agents

$ claude mcp add lofty-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact