Add .nsopus [Sakuna: Of Rice and Ruin (Switch)]

This commit is contained in:
bnnm 2020-11-15 00:20:44 +01:00
parent af5176721c
commit d4f6228809
4 changed files with 22 additions and 0 deletions

View File

@ -345,6 +345,7 @@ static const char* extension_list[] = {
"nop",
"nps",
"npsf", //fake extension/header id for .nps (in bigfiles)
"nsopus",
"nub",
"nub2",
"nus3audio",

View File

@ -645,6 +645,7 @@ VGMSTREAM* init_vgmstream_opus_nxa(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_opus_opusx(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_opus_prototype(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_opus_opusnx(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_opus_nsopus(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_opus_sqex(STREAMFILE* sf);
VGMSTREAM * init_vgmstream_raw_al(STREAMFILE * streamFile);

View File

@ -427,6 +427,25 @@ fail:
return NULL;
}
/* Edelweiss variation [Sakuna: Of Rice and Ruin (Switch)] */
VGMSTREAM* init_vgmstream_opus_nsopus(STREAMFILE* sf) {
off_t offset = 0;
int num_samples = 0, loop_start = 0, loop_end = 0;
/* checks */
if (!check_extensions(sf, "nsopus"))
goto fail;
if (read_u32be(0x00, sf) != 0x45574E4F) /* "EWNO" */
goto fail;
offset = 0x08;
num_samples = 0; //read_32bitLE(0x08, sf); /* samples without encoder delay? (lower than count) */
return init_vgmstream_opus(sf, meta_OPUS, offset, num_samples, loop_start, loop_end);
fail:
return NULL;
}
/* Square Enix variation [Dragon Quest I-III (Switch)] */
VGMSTREAM* init_vgmstream_opus_sqex(STREAMFILE* sf) {
off_t offset = 0;

View File

@ -511,6 +511,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_dsp_wiivoice,
init_vgmstream_xws,
init_vgmstream_cpk,
init_vgmstream_opus_nsopus,
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */