Add .MED RIFF using MS-IMA/PCM [LA Rush, Psi-Ops (PC)]

This commit is contained in:
bnnm 2017-06-24 23:09:30 +02:00
parent f521803f85
commit 3b4f0aae01
3 changed files with 11 additions and 1 deletions

View File

@ -168,6 +168,7 @@ DECLARE_MULTIPLE_FILE_TYPE("MCA Audio File (*.MCA)", mca);
DECLARE_MULTIPLE_FILE_TYPE("MCG Audio File (*.MCG)", mcg);
DECLARE_MULTIPLE_FILE_TYPE("MDS Audio File (*.MDS)", mds);
DECLARE_MULTIPLE_FILE_TYPE("MDSP Audio File (*.MDSP)", mdsp);
DECLARE_MULTIPLE_FILE_TYPE("MED Audio File (*.MED)", med);
DECLARE_MULTIPLE_FILE_TYPE("MI4 Audio File (*.MI4)", mi4);
DECLARE_MULTIPLE_FILE_TYPE("MIB Audio File (*.MIB)", mib);
DECLARE_MULTIPLE_FILE_TYPE("MIC Audio File (*.MIC)", mic);

View File

@ -160,6 +160,7 @@ static const char* extension_list[] = {
"mcg",
"mds",
"mdsp",
"med",
"mi4",
"mib",
"mic",

View File

@ -98,6 +98,7 @@ int read_fmt(int big_endian,
int sns,
int mwv) {
int codec;
int32_t (*read_32bit)(off_t,STREAMFILE*) = NULL;
int16_t (*read_16bit)(off_t,STREAMFILE*) = NULL;
@ -116,7 +117,13 @@ int read_fmt(int big_endian,
fmt->channel_count = read_16bit(current_chunk+0x0a,streamFile);
fmt->block_size = read_16bit(current_chunk+0x14,streamFile);
switch ((uint16_t)read_16bit(current_chunk+0x8,streamFile)) {
codec = (uint16_t)read_16bit(current_chunk+0x8,streamFile);
/* 0x007A is apparently "Voxware SC3" but in .MED it's just fake MS-IMA */
if (check_extensions(streamFile,"med") && codec == 0x007A)
codec = 0x11;
switch (codec) {
case 1: /* PCM */
switch (read_16bit(current_chunk+0x16,streamFile)) {
case 16:
@ -246,6 +253,7 @@ VGMSTREAM * init_vgmstream_riff(STREAMFILE *streamFile) {
#ifndef VGM_USE_FFMPEG
&& strcasecmp("sgb",filename_extension(filename)) /* SGB has proper support with FFmpeg in sgxd */
#endif
&& strcasecmp("med",filename_extension(filename))
)
{
if (!strcasecmp("mwv",filename_extension(filename)))