U-SING .myspd

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@724 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2010-01-10 21:22:20 +00:00
parent 862b467615
commit 52190b4720
10 changed files with 77 additions and 1 deletions

View File

@ -181,6 +181,7 @@ IMA ADPCM:
- .hwas (IMA ADPCM)
- .idvi (DVI IMA ADPCM)
- .ivaud (IMA ADPCM)
- .myspd (IMA ADPCM)
- .stma (DVI IMA ADPCM)
- .strm (IMA ADPCM)

View File

@ -216,7 +216,8 @@ META_OBJS=meta/adx_header.o \
meta/fsb_test.o \
meta/xbox_hlwav.o \
meta/stx.o \
meta/ps2_stm.o
meta/ps2_stm.o \
meta/myspd.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)

View File

@ -386,6 +386,10 @@
RelativePath=".\meta\musx.c"
>
</File>
<File
RelativePath=".\meta\myspd.c"
>
</File>
<File
RelativePath=".\meta\naomi_adpcm.c"
>

View File

@ -174,5 +174,6 @@ libmeta_la_SOURCES += fsb_test.c
libmeta_la_SOURCES += xbox_hlwav.c
libmeta_la_SOURCES += stx.c
libmeta_la_SOURCES += ps2_stm.c
libmeta_la_SOURCES += myspd.c
EXTRA_DIST = meta.h

View File

@ -429,4 +429,6 @@ VGMSTREAM * init_vgmstream_stx(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_ps2_stm(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_myspd(STREAMFILE* streamFile);
#endif

60
src/meta/myspd.c Normal file
View File

@ -0,0 +1,60 @@
#include "meta.h"
#include "../util.h"
/* U-Sing (Wii) .myspd */
VGMSTREAM * init_vgmstream_myspd(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int channel_count;
int loop_flag = 0;
off_t start_offset;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("myspd",filename_extension(filename))) goto fail;
channel_count = 2;
start_offset = 0x20;
/* check size */
if ((read_32bitBE(0x0,streamFile)*channel_count+start_offset) != get_streamfile_size(streamFile))
goto fail;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->num_samples = read_32bitBE(0x0,streamFile) * 2;
vgmstream->sample_rate = read_32bitBE(0x4,streamFile);
vgmstream->coding_type = coding_IMA;
vgmstream->meta_type = meta_MYSPD;
vgmstream->layout_type = layout_none;
/* open the file for reading */
{
STREAMFILE * file;
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!file) goto fail;
vgmstream->ch[0].streamfile = file;
vgmstream->ch[0].channel_start_offset=
vgmstream->ch[0].offset=start_offset;
file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
if (!file) goto fail;
vgmstream->ch[1].streamfile = file;
vgmstream->ch[0].channel_start_offset=
vgmstream->ch[1].offset=start_offset + read_32bitBE(0x0,streamFile);
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -235,6 +235,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_xbox_hlwav,
init_vgmstream_stx,
init_vgmstream_ps2_stm,
init_vgmstream_myspd,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@ -2364,6 +2365,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
case meta_PS2_STM:
snprintf(temp,TEMPSIZE,"Red Dead Revolver .stm (.ps2stm)");
break;
case meta_MYSPD:
snprintf(temp,TEMPSIZE,"U-Sing .myspd header");
break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
}

View File

@ -210,6 +210,7 @@ typedef enum {
meta_HALPST, /* HAL Labs HALPST */
meta_GCSW, /* GCSW (PCM) */
meta_CFN, /* Namco CAF Audio File */
meta_MYSPD, /* U-Sing .myspd */
meta_PS2_SShd, /* .ADS with SShd header */
meta_PS2_NPSF, /* Namco Production Sound File */

View File

@ -114,6 +114,7 @@ gchar *vgmstream_exts [] = {
"musx",
"mwv",
"mxst",
"myspd",
"ndp",
"npsf",

View File

@ -179,6 +179,7 @@ char * extension_list[] = {
"musx\0MUSX Audio File (*.MUSX)\0",
"mwv\0MWV Audio File (*.MWV)\0",
"mxst\0MxSt Audio File (*.MxSt)\0",
"myspd\0MYSPD Audio File (*.MYSPD)\0",
"ndp\0NDP Audio File (*.NDP)\0",
"npsf\0PS2 NPSF Audio File (*.NPSF)\0",