2 unstable releases

0.2.0 Feb 23, 2025
0.1.0 Sep 3, 2019

#448 in Audio

Download history 175/week @ 2024-12-20 74/week @ 2024-12-27 154/week @ 2025-01-03 362/week @ 2025-01-10 157/week @ 2025-01-17 259/week @ 2025-01-24 144/week @ 2025-01-31 347/week @ 2025-02-07 323/week @ 2025-02-14 483/week @ 2025-02-21 327/week @ 2025-02-28 372/week @ 2025-03-07 337/week @ 2025-03-14 238/week @ 2025-03-21 190/week @ 2025-03-28 233/week @ 2025-04-04

1,075 downloads per month
Used in 3 crates (2 directly)

MIT license

12KB
162 lines

Oggvorbismeta

Build Status

A simple Rust library to read and write VorbisComments tags in OggVorbis (*.ogg) audio files.

The basic reading and writing of Ogg files is handled by the Ogg crate: https://github.com/RustAudio/ogg

Reading out the existing comments in a file is done using the Lewton crate: https://github.com/RustAudio/lewton

See the tag_file example for basic usage. It reads the tags in an input file, prints them and then replaces them with some sample tags. The result is written to a new file.

To run the example type:

cargo run --example tag_file path/to/infile.ogg path/to/outfile.ogg

Tag names

A list of common tags can be found here: https://xiph.org/vorbis/doc/v-comment.html

Usage

The workflow is to prepare a CommentHeader structure containing all the desired tags. This is then inserted in an ogg file by the "replace_comment_header" function. This will accept anything that implements the std::io::Read and std::io::Seek traits as input, and return a std::io::Cursor wrapping a buffer in ram.

let mut f_out = replace_comment_header(f_in, new_comments);

Dependencies

~0.7–1.2MB
~27K SLoC