add support for WP2 (4 channels INT File)

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@197 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
fastelbja 2008-05-24 20:22:54 +00:00
parent e3c010f67b
commit 6fb390ea08
2 changed files with 13 additions and 8 deletions

View File

@ -15,30 +15,34 @@
VGMSTREAM * init_vgmstream_ps2_int(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
int i;
int i,channel_count;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
if (strcasecmp("int",filename_extension(filename))) goto fail;
if (strcasecmp("int",filename_extension(filename)) &&
strcasecmp("wp2",filename_extension(filename))) goto fail;
/* No check to do as they are raw pcm */
if(!strcasecmp("int",filename_extension(filename)))
channel_count = 2;
else
channel_count = 4;
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(2,0);
vgmstream = allocate_vgmstream(channel_count,0);
if (!vgmstream) goto fail;
/* fill in the vital statistics */
vgmstream->channels = 2;
vgmstream->channels=channel_count;
vgmstream->sample_rate = 48000;
vgmstream->coding_type = coding_PCM16LE;
vgmstream->num_samples = (int32_t)(get_streamfile_size(streamFile)/4);
vgmstream->num_samples = (int32_t)(get_streamfile_size(streamFile)/(vgmstream->channels*2));
vgmstream->interleave_block_size = 0x200;
vgmstream->layout_type = layout_interleave;
vgmstream->meta_type = meta_PS2_RAW;
/* open the file for reading by each channel */
{
for (i=0;i<2;i++) {
for (i=0;i<vgmstream->channels;i++) {
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,0x8000);
if (!vgmstream->ch[i].streamfile) goto fail;

View File

@ -107,7 +107,8 @@ char * extension_list[] = {
"ild\0ILD Audio File (*.ILD)\0",
"pnb\0PNB Audio File (*.PNB)\0",
"wavm\0WAVM Audio File (*.WAVM)\0",
"xwav\0XWAV Audio File (*.XWAV)\0"
"xwav\0XWAV Audio File (*.XWAV)\0",
"wp2\0WP2 Audio File (*.WP2)\0"
};
void about(HWND hwndParent) {