mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-30 20:03:44 +01:00
Add .opusx/adpcmx [Touhou Genso Wanderer -Reloaded- (Switch)]
This commit is contained in:
parent
b43bb3aefe
commit
13a7a5382d
@ -31,6 +31,7 @@ static const char* extension_list[] = {
|
|||||||
"adm",
|
"adm",
|
||||||
"adp",
|
"adp",
|
||||||
"adpcm",
|
"adpcm",
|
||||||
|
"adpcmx",
|
||||||
"ads",
|
"ads",
|
||||||
"adw",
|
"adw",
|
||||||
"adx",
|
"adx",
|
||||||
@ -272,6 +273,7 @@ static const char* extension_list[] = {
|
|||||||
"oma", //FFmpeg/not parsed (ATRAC3/ATRAC3PLUS/MP3/LPCM/WMA)
|
"oma", //FFmpeg/not parsed (ATRAC3/ATRAC3PLUS/MP3/LPCM/WMA)
|
||||||
"omu",
|
"omu",
|
||||||
//"opus", //common
|
//"opus", //common
|
||||||
|
"opusx",
|
||||||
"otm",
|
"otm",
|
||||||
"ovb",
|
"ovb",
|
||||||
|
|
||||||
@ -1120,6 +1122,7 @@ static const meta_info meta_info_list[] = {
|
|||||||
{meta_MSF_TAMASOFT, "Tama-Soft MSF header"},
|
{meta_MSF_TAMASOFT, "Tama-Soft MSF header"},
|
||||||
{meta_XPS_DAT, "From Software .XPS+DAT header"},
|
{meta_XPS_DAT, "From Software .XPS+DAT header"},
|
||||||
{meta_ZSND, "Vicarious Visions ZSND header"},
|
{meta_ZSND, "Vicarious Visions ZSND header"},
|
||||||
|
{meta_DSP_ADPCMX, "AQUASTYLE ADPY header"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ VGMSTREAM * init_vgmstream_dsp_mcadpcm(STREAMFILE *streamFile);
|
|||||||
VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile);
|
VGMSTREAM * init_vgmstream_dsp_switch_audio(STREAMFILE *streamFile);
|
||||||
VGMSTREAM * init_vgmstream_dsp_sps_n1(STREAMFILE *streamFile);
|
VGMSTREAM * init_vgmstream_dsp_sps_n1(STREAMFILE *streamFile);
|
||||||
VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile);
|
VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile);
|
||||||
|
VGMSTREAM * init_vgmstream_dsp_adpcmx(STREAMFILE *streamFile);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_csmp(STREAMFILE *streamFile);
|
VGMSTREAM * init_vgmstream_csmp(STREAMFILE *streamFile);
|
||||||
|
|
||||||
@ -663,6 +664,7 @@ VGMSTREAM * init_vgmstream_opus_shinen(STREAMFILE * streamFile);
|
|||||||
VGMSTREAM * init_vgmstream_opus_nus3(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_opus_nus3(STREAMFILE * streamFile);
|
||||||
VGMSTREAM * init_vgmstream_opus_sps_n1(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_opus_sps_n1(STREAMFILE * streamFile);
|
||||||
VGMSTREAM * init_vgmstream_opus_nxa(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_opus_nxa(STREAMFILE * streamFile);
|
||||||
|
VGMSTREAM * init_vgmstream_opus_opusx(STREAMFILE * streamFile);
|
||||||
|
|
||||||
VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile);
|
VGMSTREAM * init_vgmstream_pc_al2(STREAMFILE * streamFile);
|
||||||
|
|
||||||
|
@ -1115,7 +1115,7 @@ fail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* .vag - Nippon Ichi SPS wrapper [Penny-Punching Princess (Switch), Ys VIII (Switch)] */
|
/* .vag - Nippon Ichi SPS wrapper [Penny-Punching Princess (Switch), Ys VIII (Switch)] */
|
||||||
VGMSTREAM * init_vgmstream_dsp_sps_n1(STREAMFILE *streamFile) {//todo rename
|
VGMSTREAM * init_vgmstream_dsp_sps_n1(STREAMFILE *streamFile) {
|
||||||
dsp_meta dspm = {0};
|
dsp_meta dspm = {0};
|
||||||
|
|
||||||
/* checks */
|
/* checks */
|
||||||
@ -1168,3 +1168,31 @@ VGMSTREAM * init_vgmstream_dsp_itl_ch(STREAMFILE *streamFile) {
|
|||||||
fail:
|
fail:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .adpcmx - AQUASTYLE wrapper [Touhou Genso Wanderer -Reloaded- (Switch)] */
|
||||||
|
VGMSTREAM * init_vgmstream_dsp_adpcmx(STREAMFILE *streamFile) {
|
||||||
|
dsp_meta dspm = {0};
|
||||||
|
|
||||||
|
/* checks */
|
||||||
|
if (!check_extensions(streamFile, "adpcmx"))
|
||||||
|
goto fail;
|
||||||
|
if (read_32bitBE(0x00,streamFile) != 0x41445059) /* "ADPY" */
|
||||||
|
goto fail;
|
||||||
|
/* 0x04(2): 1? */
|
||||||
|
/* 0x08: some size? */
|
||||||
|
/* 0x0c: null */
|
||||||
|
|
||||||
|
dspm.channel_count = read_16bitLE(0x06,streamFile);
|
||||||
|
dspm.max_channels = 2;
|
||||||
|
dspm.little_endian = 1;
|
||||||
|
|
||||||
|
dspm.header_offset = 0x10;
|
||||||
|
dspm.header_spacing = 0x60;
|
||||||
|
dspm.start_offset = dspm.header_offset + dspm.header_spacing*dspm.channel_count;
|
||||||
|
dspm.interleave = 0x08;
|
||||||
|
|
||||||
|
dspm.meta_type = meta_DSP_ADPCMX;
|
||||||
|
return init_vgmstream_dsp_common(streamFile, &dspm);
|
||||||
|
fail:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -57,7 +57,6 @@ static VGMSTREAM * init_vgmstream_opus(STREAMFILE *streamFile, meta_t meta_type,
|
|||||||
goto fail;
|
goto fail;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* open the file for reading */
|
|
||||||
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
if ( !vgmstream_open_stream(vgmstream, streamFile, start_offset) )
|
||||||
goto fail;
|
goto fail;
|
||||||
return vgmstream;
|
return vgmstream;
|
||||||
@ -308,3 +307,36 @@ VGMSTREAM * init_vgmstream_opus_sps_n1(STREAMFILE *streamFile) {
|
|||||||
fail:
|
fail:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* AQUASTYLE wrapper [Touhou Genso Wanderer -Reloaded- (Switch)] */
|
||||||
|
VGMSTREAM * init_vgmstream_opus_opusx(STREAMFILE *streamFile) {
|
||||||
|
off_t offset;
|
||||||
|
int num_samples, loop_start = 0, loop_end = 0;
|
||||||
|
float modifier;
|
||||||
|
|
||||||
|
/* checks */
|
||||||
|
if (!check_extensions(streamFile, "opusx"))
|
||||||
|
goto fail;
|
||||||
|
if (read_32bitBE(0x00, streamFile) != 0x4F505553) /* "OPUS" */
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
offset = 0x10;
|
||||||
|
/* values are for the original 44100 files, but Opus resamples to 48000 */
|
||||||
|
modifier = 48000.0f / 44100.0f;
|
||||||
|
num_samples = 0;//read_32bitLE(0x04, streamFile) * modifier; /* better use calc'd num_samples */
|
||||||
|
loop_start = read_32bitLE(0x08, streamFile) * modifier;
|
||||||
|
loop_end = read_32bitLE(0x0c, streamFile) * modifier;
|
||||||
|
|
||||||
|
/* resampling calcs are slighly off and may to over num_samples, but by removing delay seems ok */
|
||||||
|
if (loop_start >= 120) {
|
||||||
|
loop_start -= 128;
|
||||||
|
loop_end -= 128;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
loop_end = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return init_vgmstream_opus(streamFile, meta_OPUS, offset, num_samples, loop_start, loop_end);
|
||||||
|
fail:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -453,6 +453,8 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
|||||||
init_vgmstream_xps_dat,
|
init_vgmstream_xps_dat,
|
||||||
init_vgmstream_xps,
|
init_vgmstream_xps,
|
||||||
init_vgmstream_zsnd,
|
init_vgmstream_zsnd,
|
||||||
|
init_vgmstream_opus_opusx,
|
||||||
|
init_vgmstream_dsp_adpcmx,
|
||||||
|
|
||||||
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
|
/* 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 */
|
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */
|
||||||
|
@ -708,6 +708,7 @@ typedef enum {
|
|||||||
meta_MSF_TAMASOFT,
|
meta_MSF_TAMASOFT,
|
||||||
meta_XPS_DAT,
|
meta_XPS_DAT,
|
||||||
meta_ZSND,
|
meta_ZSND,
|
||||||
|
meta_DSP_ADPCMX
|
||||||
|
|
||||||
} meta_t;
|
} meta_t;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user