mp3 converting with ffmpeg works

This commit is contained in:
mykola2312 2024-02-21 14:35:07 +02:00
parent c8f9972941
commit 550c27ff03
2 changed files with 7 additions and 2 deletions

View file

@ -19,6 +19,7 @@ impl FFMpeg {
output_path: &str,
bitrate: u16,
) -> Result<(), SpawnError> {
let bitrate = format!("{}k", bitrate);
let output = spawn(
"ffmpeg",
[
@ -27,7 +28,7 @@ impl FFMpeg {
"-codec:a",
"libmp3lame",
"-b:a",
"32k",
bitrate.as_str(),
output_path,
],
)

View file

@ -53,6 +53,10 @@ async fn main() -> anyhow::Result<()> {
println!("abr {}", FFMpeg::round_mp3_bitrate(129.492));
FFMpeg::convert_to_mp3("audio.m4a", "audio.mp3", 160)
.await
.expect("convert");
Ok(())
//bot_main().await
}