#ogg #vorbis #metadata #read-write

oggvorbismeta

Read and write metadata from ogg vorbis audio files

1 unstable release

0.1.0 Sep 3, 2019

#994 in Audio

Download history 57/week @ 2023-12-17 81/week @ 2023-12-24 87/week @ 2023-12-31 137/week @ 2024-01-07 208/week @ 2024-01-14 78/week @ 2024-01-21 86/week @ 2024-01-28 82/week @ 2024-02-04 99/week @ 2024-02-11 95/week @ 2024-02-18 135/week @ 2024-02-25 67/week @ 2024-03-03 59/week @ 2024-03-10 72/week @ 2024-03-17 77/week @ 2024-03-24 133/week @ 2024-03-31

350 downloads per month
Used in 3 crates (2 directly)

GPL-3.0-or-later

23KB
160 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

~530KB
~11K SLoC