Compare commits

..

No commits in common. "f9c40f79f1c847cdcbf0f4871cffe5691c0b2167" and "018eb21ecde04a85a120772845328b661c1fa026" have entirely different histories.

3 changed files with 6 additions and 36 deletions

View file

@ -26,9 +26,7 @@ The input music folder needs the following structure:
└ 💾 Music 1
```
Directory/File names must not exceed 31~ characters.
If you encounter issues with song not playing you could try to change the codec to wmav1 or lower the bitrate.
Directory/File names must not exceed 31 characters.
```
Usage: xbst [OPTIONS] [INPUT] [OUTPUT]
@ -38,16 +36,14 @@ Arguments:
[OUTPUT] Output folder for the database and converted musics [default: ./output]
Options:
-b, --bitrate <BITRATE> Bitrate for the output [default: 128]
-c, --codec <CODEC> Codec to use for conversion [default: wmav2] [possible values: wmav1, wmav2]
-b, --bitrate <BITRATE> Bitrate for the output [default: 192]
-h, --help Print help
-V, --version Print version
```
## Known issues
- The progress bar on soundtrack other than the first one doesn't progress.
- The progress bar on soundtrack other than the first one doesn't progress
- Some files, once converted, are quieter than usual?
- When using wmav1, some audio files might sounds absolute ass.
- Untested with a large library, probably has issues?
- Code is poo poo :(
- Code is poo poo

View file

@ -14,7 +14,7 @@ use deunicode::AsciiChars;
use thiserror::Error;
use zerocopy::IntoBytes;
use crate::utils::{Codec, Header, MusicFile, Song, Soundtrack};
use crate::utils::{Header, MusicFile, Song, Soundtrack};
#[derive(Error, Debug)]
enum Errors {
@ -47,10 +47,6 @@ struct Args {
/// Bitrate for the output
#[arg(short, long, default_value_t = 128)]
bitrate: i16,
/// Codec to use for conversion
#[clap(value_enum)]
#[arg(short, long, default_value_t = Codec::Wmav2)]
codec: Codec,
}
fn main() {
@ -143,11 +139,6 @@ fn process(args: &Args) -> Result<(), Errors> {
let song = f.as_ref().unwrap();
let song_path = song.path();
// Ignore non files for song groups
if !song_path.is_file() {
continue;
}
song_id[g] = total_songs_count as i32;
song_time_miliseconds[g] = match get_duration(song_path) {
Ok(s) => s,
@ -287,7 +278,6 @@ fn process(args: &Args) -> Result<(), Errors> {
f.path,
&args.output,
args.bitrate,
&args.codec,
f.soundtrack_index as usize,
f.index as usize,
)?;
@ -322,7 +312,6 @@ fn convert_to_wma(
input: PathBuf,
output: &String,
bitrate: i16,
codec: &Codec,
soundtrack_index: usize,
song_index: usize,
) -> Result<(), Errors> {
@ -337,7 +326,7 @@ fn convert_to_wma(
"-i",
input,
"-acodec",
&codec.to_string(),
"wmav1",
"-ac",
"2",
"-ar",

View file

@ -9,21 +9,6 @@ pub struct MusicFile {
pub index: u32,
}
#[derive(clap::ValueEnum, Debug, Clone)]
pub enum Codec {
Wmav1,
Wmav2,
}
impl ToString for Codec {
fn to_string(&self) -> String {
match self {
Codec::Wmav1 => String::from("wmav1"),
Codec::Wmav2 => String::from("wmav2"),
}
}
}
// https://xboxdevwiki.net/Soundtracks#ST.DB
#[derive(Debug, Immutable, IntoBytes)]
#[repr(C)]