Voice recording with small size in rust language

Viewed 41

I want to record high quality audio with a small storage size I used this code, the recording is done, but the size is large and does not support mp3. Only the wav format works with this code. Please help Here is the code

fn record_voice() {
    match ac::record(None) {
        Ok(clip) => {
            println!("Successfully recorded!");
            match clip.export(format!("record.wav").as_str()) {
                Ok(_) => {
                    println!("Successfully saved as ");

                    // clip..unwrap();
                }
                Err(err) => println!("Error {}", err),
            }
        }
        Err(err) => println!("Error {}", err),
    }
}
0 Answers
Related