mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-14 18:47:39 +01:00
Add RSD6WMA [Scarface (Xbox)]
This commit is contained in:
parent
bd684f7680
commit
a53712d495
@ -726,23 +726,24 @@ static const meta_info meta_info_list[] = {
|
||||
{meta_PS2_MIHB, "MIH+MIB header"},
|
||||
{meta_DSP_WII_MUS, "mus header"},
|
||||
{meta_WII_SNG, "SNG DSP Header"},
|
||||
{meta_RSD2VAG, "RSD2/VAG Header"},
|
||||
{meta_RSD2PCMB, "RSD2/PCMB Header"},
|
||||
{meta_RSD2XADP, "RSD2/XADP Header"},
|
||||
{meta_RSD3VAG, "RSD3/VAG Header"},
|
||||
{meta_RSD3GADP, "RSD3/GADP Header"},
|
||||
{meta_RSD3PCM, "RSD3/PCM Header"},
|
||||
{meta_RSD3PCMB, "RSD3/PCMB Header"},
|
||||
{meta_RSD4PCMB, "RSD4/PCMB Header"},
|
||||
{meta_RSD4PCM, "RSD4/PCM Header"},
|
||||
{meta_RSD4RADP, "RSD4/RADP Header"},
|
||||
{meta_RSD4VAG, "RSD4/VAG Header"},
|
||||
{meta_RSD6XADP, "RSD6/XADP Header"},
|
||||
{meta_RSD6VAG, "RSD6/VAG Header"},
|
||||
{meta_RSD6WADP, "RSD6/WADP Header"},
|
||||
{meta_RSD6RADP, "RSD6/RADP Header"},
|
||||
{meta_RSD6XMA, "RSD6/XMA Header"},
|
||||
{meta_RSD6AT3P, "RSD6/AT3+ Header"},
|
||||
{meta_RSD2VAG, "Radical RSD2/VAG header"},
|
||||
{meta_RSD2PCMB, "Radical RSD2/PCMB header"},
|
||||
{meta_RSD2XADP, "Radical RSD2/XADP header"},
|
||||
{meta_RSD3VAG, "Radical RSD3/VAG header"},
|
||||
{meta_RSD3GADP, "Radical RSD3/GADP header"},
|
||||
{meta_RSD3PCM, "Radical RSD3/PCM header"},
|
||||
{meta_RSD3PCMB, "Radical RSD3/PCMB header"},
|
||||
{meta_RSD4PCMB, "Radical RSD4/PCMB header"},
|
||||
{meta_RSD4PCM, "Radical RSD4/PCM header"},
|
||||
{meta_RSD4RADP, "Radical RSD4/RADP header"},
|
||||
{meta_RSD4VAG, "Radical RSD4/VAG header"},
|
||||
{meta_RSD6XADP, "Radical RSD6/XADP header"},
|
||||
{meta_RSD6VAG, "Radical RSD6/VAG header"},
|
||||
{meta_RSD6WADP, "Radical RSD6/WADP header"},
|
||||
{meta_RSD6RADP, "Radical RSD6/RADP header"},
|
||||
{meta_RSD6XMA, "Radical RSD6/XMA header"},
|
||||
{meta_RSD6AT3P, "Radical RSD6/AT3+ header"},
|
||||
{meta_RSD6WMA, "Radical RSD6/WMA header"},
|
||||
{meta_DC_ASD, "ASD Header"},
|
||||
{meta_NAOMI_SPSD, "SPSD Header"},
|
||||
{meta_FFXI_BGW, "BGW BGMStream header"},
|
||||
|
@ -307,6 +307,7 @@ VGMSTREAM * init_vgmstream_rsd6radp(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_rsd6oogv(STREAMFILE* streamFile);
|
||||
VGMSTREAM * init_vgmstream_rsd6xma(STREAMFILE *streamFile);
|
||||
VGMSTREAM * init_vgmstream_rsd6at3p(STREAMFILE * streamFile);
|
||||
VGMSTREAM * init_vgmstream_rsd6wma(STREAMFILE * streamFile);
|
||||
|
||||
VGMSTREAM * init_vgmstream_dc_asd(STREAMFILE * streamFile);
|
||||
|
||||
|
@ -1079,7 +1079,6 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* RSD6AT3+ [Crash of the Titans (PSP)] */
|
||||
VGMSTREAM * init_vgmstream_rsd6at3p(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
@ -1093,13 +1092,13 @@ VGMSTREAM * init_vgmstream_rsd6at3p(STREAMFILE *streamFile) {
|
||||
goto fail;
|
||||
|
||||
/* check header */
|
||||
if (read_32bitBE(0x0, streamFile) != 0x52534436) /* "RSD6" */
|
||||
if (read_32bitBE(0x00,streamFile) != 0x52534436) /* "RSD6" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x4154332B) /* "AT3+" */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = read_32bitLE(0x8, streamFile);
|
||||
channel_count = read_32bitLE(0x08, streamFile);
|
||||
start_offset = 0x800;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
|
||||
@ -1114,7 +1113,7 @@ VGMSTREAM * init_vgmstream_rsd6at3p(STREAMFILE *streamFile) {
|
||||
{
|
||||
ffmpeg_codec_data *ffmpeg_data = NULL;
|
||||
|
||||
/* full RIFF header at start_offset/post_meta_offset (same) */
|
||||
/* full RIFF header at start_offset */
|
||||
ffmpeg_data = init_ffmpeg_offset(streamFile, start_offset,data_size);
|
||||
if (!ffmpeg_data) goto fail;
|
||||
vgmstream->codec_data = ffmpeg_data;
|
||||
@ -1151,3 +1150,60 @@ fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* RSD6WMA [Scarface (Xbox)] */
|
||||
VGMSTREAM * init_vgmstream_rsd6wma(STREAMFILE *streamFile) {
|
||||
VGMSTREAM * vgmstream = NULL;
|
||||
off_t start_offset;
|
||||
size_t data_size;
|
||||
int loop_flag, channel_count;
|
||||
|
||||
|
||||
/* checks */
|
||||
if (!check_extensions(streamFile,"rsd"))
|
||||
goto fail;
|
||||
if (read_32bitBE(0x00,streamFile) != 0x52534436) /* "RSD6" */
|
||||
goto fail;
|
||||
if (read_32bitBE(0x04,streamFile) != 0x574D4120) /* "WMA " */
|
||||
goto fail;
|
||||
|
||||
loop_flag = 0;
|
||||
channel_count = read_32bitLE(0x08, streamFile);
|
||||
start_offset = 0x800;
|
||||
data_size = get_streamfile_size(streamFile) - start_offset;
|
||||
|
||||
/* build the VGMSTREAM */
|
||||
vgmstream = allocate_vgmstream(channel_count,loop_flag);
|
||||
if (!vgmstream) goto fail;
|
||||
|
||||
vgmstream->meta_type = meta_RSD6WMA;
|
||||
//vgmstream->num_samples = read_32bitLE(start_offset + 0x00, streamFile); /* ? */
|
||||
vgmstream->sample_rate = read_32bitLE(start_offset + 0x04, streamFile);
|
||||
|
||||
#ifdef VGM_USE_FFMPEG
|
||||
{
|
||||
ffmpeg_codec_data *ffmpeg_data = NULL;
|
||||
|
||||
/* mini header + WMA header at start_offset */
|
||||
ffmpeg_data = init_ffmpeg_offset(streamFile, start_offset+0x08,data_size);
|
||||
if (!ffmpeg_data) goto fail;
|
||||
vgmstream->codec_data = ffmpeg_data;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
vgmstream->num_samples = (int32_t)ffmpeg_data->totalSamples; /* probably an estimation */
|
||||
|
||||
#else
|
||||
goto fail;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!vgmstream_open_stream(vgmstream, streamFile, start_offset))
|
||||
goto fail;
|
||||
return vgmstream;
|
||||
|
||||
fail:
|
||||
close_vgmstream(vgmstream);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -383,6 +383,7 @@ VGMSTREAM * (*init_vgmstream_functions[])(STREAMFILE *streamFile) = {
|
||||
init_vgmstream_wave,
|
||||
init_vgmstream_wave_segmented,
|
||||
init_vgmstream_rsd6at3p,
|
||||
init_vgmstream_rsd6wma,
|
||||
|
||||
init_vgmstream_txth, /* should go at the end (lower priority) */
|
||||
#ifdef VGM_USE_FFMPEG
|
||||
|
@ -425,6 +425,7 @@ typedef enum {
|
||||
meta_RSD6OOGV, /* RSD6OOGV */
|
||||
meta_RSD6XMA, /* RSD6XMA */
|
||||
meta_RSD6AT3P, /* RSD6AT3+ */
|
||||
meta_RSD6WMA, /* RSD6WMA */
|
||||
|
||||
meta_PS2_ASS, /* ASS */
|
||||
meta_PS2_SEG, /* Eragon */
|
||||
|
Loading…
Reference in New Issue
Block a user