reword error message in example and remove is_file check
This commit is contained in:
parent
3c216269e3
commit
e00568e801
1 changed files with 4 additions and 4 deletions
|
|
@ -31,15 +31,15 @@ fn main() {
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.expect("first argument should be path to WAV file");
|
.expect("first argument should be path to WAV file");
|
||||||
let audio_path = Path::new(&arg1);
|
let audio_path = Path::new(&arg1);
|
||||||
if !audio_path.exists() && !audio_path.is_file() {
|
if !audio_path.exists() {
|
||||||
panic!("expected a file");
|
panic!("audio file doesn't exist");
|
||||||
}
|
}
|
||||||
let arg2 = std::env::args()
|
let arg2 = std::env::args()
|
||||||
.nth(2)
|
.nth(2)
|
||||||
.expect("second argument should be path to Whisper model");
|
.expect("second argument should be path to Whisper model");
|
||||||
let whisper_path = Path::new(&arg2);
|
let whisper_path = Path::new(&arg2);
|
||||||
if !whisper_path.exists() && !whisper_path.is_file() {
|
if !whisper_path.exists() {
|
||||||
panic!("expected a whisper directory")
|
panic!("whisper file doesn't exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
let original_samples = parse_wav_file(audio_path);
|
let original_samples = parse_wav_file(audio_path);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue