Crates.io | mp3cut |
lib.rs | mp3cut |
version | 0.1.0 |
source | src |
created_at | 2022-06-07 21:51:22.350296 |
updated_at | 2022-06-07 21:51:22.350296 |
description | mp3 file splitter |
homepage | |
repository | https://gitlab.com/anthony-tron/mp3cut |
max_upload_size | |
id | 601725 |
size | 14,725 |
A mp3 file splitter helpful to cut a single mp3 file into multiple files.
// chapters.txt
0:00 Song 1
2:34 Song 2
4:09 Song 3
mp3cut -o outdir chapters.txt source.mp3
out
├── Song 1.mp3
├── Song 2.mp3
└── Song 3.mp3
Chapter
let chapters_data = std::fs::read_to_string("chapters.txt").unwrap();
let chapters = Chapter::from(chapters_data).unwrap();
// [{ title: "Song 1", timestamp: 0:00 },
// { title: "Song 2", timestamp: 2:34 },
// { title: "Song 3", timestamp: 4:09 }]
find_mp3_bounds
let mp3_data = std::fs::read("source.mp3");
let bounds = mp3cut::find_mp3_bounds(&mp3_data, &chapters);
// [23_442, 449_396, 889_292, 1_234_567]