Support displaying name of missing file for CDDA tracks

This commit is contained in:
2024-08-14 15:30:13 -05:00
parent f22103ed77
commit 52083c52f7
3 changed files with 10 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "psxcdgen_ex"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
[profile.release]

View File

@@ -233,8 +233,13 @@ fn parse_configuration(config: config_reader::Configuration) -> Result<(CDDesc,
}
for cd_da_file in cd_da_files {
let mut audio_io = hound::WavReader::open(&cd_da_file.file_path)?;
let header = audio_io.spec();
let mut audio_io = {
match hound::WavReader::open(&cd_da_file.file_path) {
Ok(audio_io) => Ok(audio_io),
Err(error) => Err(Error::from_text(format!("Failed to open CD Audio Track {} with error: {}", cd_da_file.file_path.to_string_lossy(), error)))
}
}?;
let header = audio_io.spec();
if header.sample_format != hound::SampleFormat::Int {
return Err(Error::from_text(format!("{}: Only integer WAV format (PCM) is supported for Audio tracks", cd_da_file.file_path.display())));