Update README.md

This commit is contained in:
Alex 2021-04-02 20:50:28 -04:00 committed by GitHub
parent 555819e6a8
commit d92feae583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,12 @@
# audiotags
# Lofty
[![Crate](https://img.shields.io/crates/v/audiotags.svg)](https://crates.io/crates/audiotags)
[![Crate](https://img.shields.io/crates/d/audiotags.svg)](https://crates.io/crates/audiotags)
[![Crate](https://img.shields.io/crates/l/audiotags.svg)](https://crates.io/crates/audiotags)
[![Documentation](https://docs.rs/audiotags/badge.svg)](https://docs.rs/audiotags/)
[![Manual](https://img.shields.io/badge/RTFM-Manual-blue)](https://tianyishi2001.github.io/audiotags)
[![Crate](https://img.shields.io/crates/v/lofty.svg)](https://crates.io/crates/lofty)
[![Crate](https://img.shields.io/crates/d/lofty.svg)](https://crates.io/crates/lofty)
[![Crate](https://img.shields.io/crates/l/lofty.svg)](https://crates.io/crates/lofty)
[![Documentation](https://docs.rs/lofty/badge.svg)](https://docs.rs/lofty/)
[![Manual](https://img.shields.io/badge/RTFM-Manual-blue)](https://tianyishi2001.github.io/lofty)
**audiotags** makes it easier to **parse, convert and write metadata** (a.k.a tag) in audio files of different file types.
**Lofty** makes it easier to **parse, convert and write metadata** (a.k.a tag) in audio files of different file types.
This crate aims to provide a unified trait for parsers and writers of different audio file formats. This means that you can parse tags in mp3, flac, and m4a files with a single function: `Tag::default().read_from_path()` and get fields by directly calling `.album()`, `.artist()` on its result. Without this crate, you would otherwise need to learn different APIs in **id3**, **mp4ameta** etc. in order to parse metadata in different file formats.
@ -18,9 +18,9 @@ Examples can be found in the [manual](https://tianyishi2001.github.io/audiotags)
## Performance
Using **audiotags** incurs a little overhead due to vtables if you want to guess the metadata format (from file extension). Apart from this the performance is almost the same as directly calling function provided by those 'specialized' crates. (It is possible to use **audiotags** *without* dynamic dispatch, in which case you need to specify the tag type but benefit from speed improvement).
Using **Lofty** incurs a little overhead due to vtables if you want to guess the metadata format (from file extension). Apart from this the performance is almost the same as directly calling function provided by those 'specialized' crates. (It is possible to use **Lofty** *without* dynamic dispatch, in which case you need to specify the tag type but benefit from speed improvement).
No copies will be made if you only need to read and write metadata of one format. If you want to convert between tags, copying is unavoidable no matter if you use **audiotags** or use getters and setters provided by specialized libraries. **audiotags** is not making additional unnecessary copies.
No copies will be made if you only need to read and write metadata of one format. If you want to convert between tags, copying is unavoidable no matter if you use **Lofty** or use getters and setters provided by specialized libraries. **Lofty** is not making additional unnecessary copies.
Theoretically it is possible to achieve zero-copy conversions if all parsers can parse into a unified struct. However, this is going to be a lot of work. I might be able to implement them, but it will be no sooner than the Christmas vacation.
@ -76,4 +76,4 @@ pub trait AudioTagEdit{
fn set_total_discs(&mut self, total_discs: u16);
fn remove_total_discs(&mut self);
}
```
```