mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-16 10:52:32 +01:00
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:
parent
e3c010f67b
commit
6fb390ea08
@ -15,30 +15,34 @@
|
|||||||
VGMSTREAM * init_vgmstream_ps2_int(STREAMFILE *streamFile) {
|
VGMSTREAM * init_vgmstream_ps2_int(STREAMFILE *streamFile) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM * vgmstream = NULL;
|
||||||
char filename[260];
|
char filename[260];
|
||||||
int i;
|
int i,channel_count;
|
||||||
|
|
||||||
/* check extension, case insensitive */
|
/* check extension, case insensitive */
|
||||||
streamFile->get_name(streamFile,filename,sizeof(filename));
|
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 */
|
/* build the VGMSTREAM */
|
||||||
vgmstream = allocate_vgmstream(2,0);
|
vgmstream = allocate_vgmstream(channel_count,0);
|
||||||
if (!vgmstream) goto fail;
|
if (!vgmstream) goto fail;
|
||||||
|
|
||||||
/* fill in the vital statistics */
|
/* fill in the vital statistics */
|
||||||
vgmstream->channels = 2;
|
vgmstream->channels=channel_count;
|
||||||
vgmstream->sample_rate = 48000;
|
vgmstream->sample_rate = 48000;
|
||||||
vgmstream->coding_type = coding_PCM16LE;
|
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->interleave_block_size = 0x200;
|
||||||
vgmstream->layout_type = layout_interleave;
|
vgmstream->layout_type = layout_interleave;
|
||||||
vgmstream->meta_type = meta_PS2_RAW;
|
vgmstream->meta_type = meta_PS2_RAW;
|
||||||
|
|
||||||
/* open the file for reading by each channel */
|
/* 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);
|
vgmstream->ch[i].streamfile = streamFile->open(streamFile,filename,0x8000);
|
||||||
|
|
||||||
if (!vgmstream->ch[i].streamfile) goto fail;
|
if (!vgmstream->ch[i].streamfile) goto fail;
|
||||||
|
@ -107,7 +107,8 @@ char * extension_list[] = {
|
|||||||
"ild\0ILD Audio File (*.ILD)\0",
|
"ild\0ILD Audio File (*.ILD)\0",
|
||||||
"pnb\0PNB Audio File (*.PNB)\0",
|
"pnb\0PNB Audio File (*.PNB)\0",
|
||||||
"wavm\0WAVM Audio File (*.WAVM)\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) {
|
void about(HWND hwndParent) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user