mp3 converting with ffmpeg works
This commit is contained in:
parent
c8f9972941
commit
550c27ff03
2 changed files with 7 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ impl FFMpeg {
|
||||||
output_path: &str,
|
output_path: &str,
|
||||||
bitrate: u16,
|
bitrate: u16,
|
||||||
) -> Result<(), SpawnError> {
|
) -> Result<(), SpawnError> {
|
||||||
|
let bitrate = format!("{}k", bitrate);
|
||||||
let output = spawn(
|
let output = spawn(
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
[
|
[
|
||||||
|
|
@ -27,7 +28,7 @@ impl FFMpeg {
|
||||||
"-codec:a",
|
"-codec:a",
|
||||||
"libmp3lame",
|
"libmp3lame",
|
||||||
"-b:a",
|
"-b:a",
|
||||||
"32k",
|
bitrate.as_str(),
|
||||||
output_path,
|
output_path,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ async fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
println!("abr {}", FFMpeg::round_mp3_bitrate(129.492));
|
println!("abr {}", FFMpeg::round_mp3_bitrate(129.492));
|
||||||
|
|
||||||
|
FFMpeg::convert_to_mp3("audio.m4a", "audio.mp3", 160)
|
||||||
|
.await
|
||||||
|
.expect("convert");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
//bot_main().await
|
//bot_main().await
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue