Added experimental support for bfwav

This commit is contained in:
soneek 2014-08-02 19:10:45 -04:00
parent a2af756764
commit b1e5a3a9e3
8 changed files with 483 additions and 305 deletions

View File

@ -297,6 +297,7 @@ bool input_vgmstream::g_is_our_path(const char * p_path,const char * p_extension
if(!stricmp_utf8(p_extension,"bar")) return 1;
if(!stricmp_utf8(p_extension,"bcstm")) return 1;
if(!stricmp_utf8(p_extension,"bcwav")) return 1;
if(!stricmp_utf8(p_extension,"bfwav")) return 1;
if(!stricmp_utf8(p_extension,"bg00")) return 1;
if(!stricmp_utf8(p_extension,"bgw")) return 1;
if(!stricmp_utf8(p_extension,"bh2pcm")) return 1;
@ -621,6 +622,7 @@ DECLARE_MULTIPLE_FILE_TYPE("BAF Audio File (*.BAF)", baf);
DECLARE_MULTIPLE_FILE_TYPE("BAR Audio File (*.BAR)", bar);
DECLARE_MULTIPLE_FILE_TYPE("BCSTM Audio File (*.BCSTM)", bcstm);
DECLARE_MULTIPLE_FILE_TYPE("BCWAV Audio File (*.BCWAV)", bcwav);
DECLARE_MULTIPLE_FILE_TYPE("BFWAV Audio File (*.BFWAV)", bfwav);
DECLARE_MULTIPLE_FILE_TYPE("BG00 Audio File (*.BG00)", bg00);
DECLARE_MULTIPLE_FILE_TYPE("BGW Audio File (*.BGW)", bgw);
DECLARE_MULTIPLE_FILE_TYPE("BH2PCM Audio File (*.BH2PCM)", bh2pcm);

View File

@ -1,306 +1,307 @@
CODING_OBJS=coding/adx_decoder.o \
coding/g721_decoder.o \
coding/ima_decoder.o \
coding/ngc_afc_decoder.o \
coding/ngc_dsp_decoder.o \
coding/ngc_dtk_decoder.o \
coding/pcm_decoder.o \
coding/psx_decoder.o \
coding/xa_decoder.o \
coding/eaxa_decoder.o \
coding/ogg_vorbis_decoder.o \
coding/sdx2_decoder.o \
coding/ws_decoder.o \
coding/mpeg_decoder.o \
coding/acm_decoder.o \
coding/nwa_decoder.o \
coding/msadpcm_decoder.o \
coding/aica_decoder.o \
coding/nds_procyon_decoder.o \
coding/l5_555_decoder.o \
coding/SASSC_decoder.o \
coding/g7221_decoder.o \
coding/lsf_decoder.o\
coding/mtaf_decoder.o
LAYOUT_OBJS=layout/ast_blocked.o \
layout/blocked.o \
layout/halpst_blocked.o \
layout/interleave.o \
layout/nolayout.o \
layout/xa_blocked.o \
layout/caf_blocked.o \
layout/ea_block.o \
layout/wsi_blocked.o \
layout/str_snds_blocked.o \
layout/ws_aud_blocked.o \
layout/interleave_byte.o \
layout/mus_acm_layout.o \
layout/aix_layout.o \
layout/ims_block.o \
layout/de2_blocked.o \
layout/xvas_block.o \
layout/vs_blocked.o \
layout/emff_blocked.o \
layout/thp_blocked.o \
layout/gsb_blocked.o \
layout/filp_blocked.o \
layout/aax_layout.o \
layout/ivaud_layout.o \
layout/mxch_blocked.o \
layout/psx_mgav_blocked.o \
layout/ps2_adm_blocked.o \
layout/bdsp_blocked.o \
layout/tra_blocked.o \
layout/ps2_iab_blocked.o \
layout/ps2_strlr_blocked.o \
layout/scd_int_layout.o
META_OBJS=meta/adx_header.o \
meta/afc_header.o \
meta/agsc.o \
meta/ast.o \
meta/brstm.o \
meta/halpst.o \
meta/nds_strm.o \
meta/ngc_adpdtk.o \
meta/rsf.o \
meta/rs03.o \
meta/ngc_dsp_std.o \
meta/Cstr.o \
meta/gcsw.o \
meta/ps2_ads.o \
meta/ps2_npsf.o \
meta/rwsd.o \
meta/psx_cdxa.o \
meta/ps2_rxw.o \
meta/ps2_int.o \
meta/ps2_exst.o \
meta/ps2_svag.o \
meta/ps2_mib.o \
meta/ps2_mic.o \
meta/raw.o \
meta/ps2_vag.o \
meta/psx_gms.o \
meta/ps2_str.o \
meta/ps2_ild.o \
meta/ps2_pnb.o \
meta/xbox_wavm.o \
meta/xbox_xwav.o \
meta/ea_header.o \
meta/ngc_caf.o \
meta/ps2_vpk.o \
meta/genh.o \
meta/ogg_vorbis_file.o \
meta/ps2_bmdx.o \
meta/aifc.o \
meta/str_snds.o \
meta/ws_aud.o \
meta/ahx.o \
meta/ivb.o \
meta/svs.o \
meta/riff.o \
meta/pos.o \
meta/nwa.o \
meta/ps2_rws.o \
meta/ps2_hgc1.o \
meta/xss.o \
meta/ps2_sl3.o \
meta/ps2_aus.o \
meta/fsb.o \
meta/rsd.o \
meta/rwx.o \
meta/xwb.o \
meta/ea_old.o \
meta/ps2_xa30.o \
meta/musc.o \
meta/musx.o \
meta/ps2_leg.o \
meta/ps2_filp.o \
meta/ps2_ikm.o \
meta/ps2_sfs.o \
meta/sat_dvi.o \
meta/ps2_bg00.o \
meta/dc_kcey.o \
meta/ps2_rstm.o \
meta/acm.o \
meta/mus_acm.o \
meta/ps2_kces.o \
meta/ps2_dxh.o \
meta/ps2_psh.o \
meta/sli.o \
meta/sfl.o \
meta/pcm.o \
meta/ps2_psw.o \
meta/rkv.o \
meta/ps2_vas.o \
meta/ps2_tec.o \
meta/ps2_enth.o \
meta/sdt.o \
meta/aix.o \
meta/ngc_tydsp.o \
meta/wvs.o \
meta/xbox_ims.o \
meta/xbox_stma.o \
meta/de2.o \
meta/dc_str.o \
meta/xbox_xmu.o \
meta/ngc_bh2pcm.o \
meta/xbox_xvas.o \
meta/sat_sap.o \
meta/sat_sap.o \
meta/dc_idvi.o \
meta/ps2_rnd.o \
meta/kraw.o \
meta/ps2_xa2.o \
meta/idsp.o \
meta/ngc_ymf.o \
meta/nds_sad.o \
meta/ps2_ccc.o \
meta/psx_fag.o \
meta/ps2_mihb.o \
meta/ngc_pdt.o \
meta/wii_mus.o \
meta/dc_asd.o \
meta/naomi_spsd.o \
meta/bgw.o \
meta/ps2_ass.o \
meta/ngc_waa_wac_wad_wam.o \
meta/seg.o \
meta/str_asr.o \
meta/zwdsp.o \
meta/gca.o \
meta/ish_isd.o \
meta/spt_spd.o \
meta/ydsp.o \
meta/gsp_gsb.o \
meta/ngc_ssm.o \
meta/msvp.o \
meta/ps2_joe.o \
meta/vgs.o \
meta/vs.o \
meta/dc_dcsw_dcs.o \
meta/wii_smp.o \
meta/ss_stream.o \
meta/emff.o \
meta/thp.o \
meta/wii_sts.o \
meta/capdsp.o \
meta/wii_sng.o \
meta/aax.o \
meta/ps2_p2bt.o \
meta/ps2_gbts.o \
meta/ngc_ffcc_str.o \
meta/sat_baka.o \
meta/nds_swav.o \
meta/vsf.o \
meta/nds_rrds.o \
meta/ps2_tk5.o \
meta/ads.o \
meta/wii_str.o \
meta/zsd.o \
meta/ps2_mcg.o \
meta/redspark.o \
meta/ps2_vgs.o \
meta/ivaud.o \
meta/ps2_sps.o \
meta/nds_hwas.o \
meta/ngc_lps.o \
meta/ps2_snd.o \
meta/naomi_adpcm.o \
meta/sd9.o \
meta/2dx9.o \
meta/ngc_dsp_ygo.o \
meta/ps2_vgv.o \
meta/ngc_gcub.o \
meta/maxis_xa.o \
meta/ngc_sck_dsp.o \
meta/apple_caff.o \
meta/pc_mxst.o \
meta/pc_sob.o \
meta/exakt_sc.o \
meta/wii_bns.o \
meta/pona.o \
meta/xbox_hlwav.o \
meta/stx.o \
meta/ps2_stm.o \
meta/myspd.o \
meta/his.o \
meta/ps2_ast.o \
meta/dmsg_segh.o \
meta/ngc_dsp_konami.o \
meta/ps2_ster.o \
meta/ps2_wb.o \
meta/bnsf.o \
meta/s14_sss.o \
meta/ps2_gcm.o \
meta/ps2_smpl.o \
meta/ps2_msa.o \
meta/pc_smp.o \
meta/p3d.o \
meta/ps2_adsc.o \
meta/psx_str_mgav.o \
meta/ngc_bo2.o \
meta/ngc_dsp_mpds.o \
meta/ps2_khv.o \
meta/ps2_voi.o \
meta/dsp_sth_str.o \
meta/ps2_b1s.o \
meta/ps2_wad.o \
meta/ps2_voi.o \
meta/ps2_lpcm.o \
meta/ps2_adm.o \
meta/dsp_bdsp.o \
meta/ps2_vms.o \
meta/ps2_xau.o \
meta/gh3_bar.o \
meta/ffw.o \
meta/ps2_jstm.o \
meta/ps3_xvag.o \
meta/ps3_cps.o \
meta/sqex_scd.o \
meta/ngc_nst_dsp.o \
meta/baf.o \
meta/ps3_msf.o \
meta/nub.o \
meta/ps3_past.o \
meta/ps3_sgh_sgb.o \
meta/ngca.o \
meta/wii_ras.o \
meta/ps2_spm.o \
meta/ps2_mtaf.o \
meta/x360_tra.o \
meta/ps2_iab.o \
meta/ps2_strlr.o \
meta/lsf.o \
meta/ps3_vawx.o \
meta/pc_snds.o \
meta/ps2_wmus.o \
meta/mattel_hyperscan.o \
meta/ios_psnd.o \
meta/pc_adp.o \
meta/excitebots.o \
meta/ps3_klbs.o \
meta/ps2_mtaf.o \
meta/tun.o \
meta/wpd.o \
meta/mn_str.o \
meta/ps2_mss.o \
meta/ps2_hsf.o \
meta/ps3_ivag.o \
meta/ps2_2pfs.o \
meta/ubi_ckd.o \
CODING_OBJS=coding/adx_decoder.o \
coding/g721_decoder.o \
coding/ima_decoder.o \
coding/ngc_afc_decoder.o \
coding/ngc_dsp_decoder.o \
coding/ngc_dtk_decoder.o \
coding/pcm_decoder.o \
coding/psx_decoder.o \
coding/xa_decoder.o \
coding/eaxa_decoder.o \
coding/ogg_vorbis_decoder.o \
coding/sdx2_decoder.o \
coding/ws_decoder.o \
coding/mpeg_decoder.o \
coding/acm_decoder.o \
coding/nwa_decoder.o \
coding/msadpcm_decoder.o \
coding/aica_decoder.o \
coding/nds_procyon_decoder.o \
coding/l5_555_decoder.o \
coding/SASSC_decoder.o \
coding/g7221_decoder.o \
coding/lsf_decoder.o\
coding/mtaf_decoder.o
LAYOUT_OBJS=layout/ast_blocked.o \
layout/blocked.o \
layout/halpst_blocked.o \
layout/interleave.o \
layout/nolayout.o \
layout/xa_blocked.o \
layout/caf_blocked.o \
layout/ea_block.o \
layout/wsi_blocked.o \
layout/str_snds_blocked.o \
layout/ws_aud_blocked.o \
layout/interleave_byte.o \
layout/mus_acm_layout.o \
layout/aix_layout.o \
layout/ims_block.o \
layout/de2_blocked.o \
layout/xvas_block.o \
layout/vs_blocked.o \
layout/emff_blocked.o \
layout/thp_blocked.o \
layout/gsb_blocked.o \
layout/filp_blocked.o \
layout/aax_layout.o \
layout/ivaud_layout.o \
layout/mxch_blocked.o \
layout/psx_mgav_blocked.o \
layout/ps2_adm_blocked.o \
layout/bdsp_blocked.o \
layout/tra_blocked.o \
layout/ps2_iab_blocked.o \
layout/ps2_strlr_blocked.o \
layout/scd_int_layout.o
META_OBJS=meta/adx_header.o \
meta/afc_header.o \
meta/agsc.o \
meta/ast.o \
meta/brstm.o \
meta/halpst.o \
meta/nds_strm.o \
meta/ngc_adpdtk.o \
meta/rsf.o \
meta/rs03.o \
meta/ngc_dsp_std.o \
meta/Cstr.o \
meta/gcsw.o \
meta/ps2_ads.o \
meta/ps2_npsf.o \
meta/rwsd.o \
meta/psx_cdxa.o \
meta/ps2_rxw.o \
meta/ps2_int.o \
meta/ps2_exst.o \
meta/ps2_svag.o \
meta/ps2_mib.o \
meta/ps2_mic.o \
meta/raw.o \
meta/ps2_vag.o \
meta/psx_gms.o \
meta/ps2_str.o \
meta/ps2_ild.o \
meta/ps2_pnb.o \
meta/xbox_wavm.o \
meta/xbox_xwav.o \
meta/ea_header.o \
meta/ngc_caf.o \
meta/ps2_vpk.o \
meta/genh.o \
meta/ogg_vorbis_file.o \
meta/ps2_bmdx.o \
meta/aifc.o \
meta/str_snds.o \
meta/ws_aud.o \
meta/ahx.o \
meta/ivb.o \
meta/svs.o \
meta/riff.o \
meta/pos.o \
meta/nwa.o \
meta/ps2_rws.o \
meta/ps2_hgc1.o \
meta/xss.o \
meta/ps2_sl3.o \
meta/ps2_aus.o \
meta/fsb.o \
meta/rsd.o \
meta/rwx.o \
meta/xwb.o \
meta/ea_old.o \
meta/ps2_xa30.o \
meta/musc.o \
meta/musx.o \
meta/ps2_leg.o \
meta/ps2_filp.o \
meta/ps2_ikm.o \
meta/ps2_sfs.o \
meta/sat_dvi.o \
meta/ps2_bg00.o \
meta/dc_kcey.o \
meta/ps2_rstm.o \
meta/acm.o \
meta/mus_acm.o \
meta/ps2_kces.o \
meta/ps2_dxh.o \
meta/ps2_psh.o \
meta/sli.o \
meta/sfl.o \
meta/pcm.o \
meta/ps2_psw.o \
meta/rkv.o \
meta/ps2_vas.o \
meta/ps2_tec.o \
meta/ps2_enth.o \
meta/sdt.o \
meta/aix.o \
meta/ngc_tydsp.o \
meta/wvs.o \
meta/xbox_ims.o \
meta/xbox_stma.o \
meta/de2.o \
meta/dc_str.o \
meta/xbox_xmu.o \
meta/ngc_bh2pcm.o \
meta/xbox_xvas.o \
meta/sat_sap.o \
meta/sat_sap.o \
meta/dc_idvi.o \
meta/ps2_rnd.o \
meta/kraw.o \
meta/ps2_xa2.o \
meta/idsp.o \
meta/ngc_ymf.o \
meta/nds_sad.o \
meta/ps2_ccc.o \
meta/psx_fag.o \
meta/ps2_mihb.o \
meta/ngc_pdt.o \
meta/wii_mus.o \
meta/dc_asd.o \
meta/naomi_spsd.o \
meta/bgw.o \
meta/ps2_ass.o \
meta/ngc_waa_wac_wad_wam.o \
meta/seg.o \
meta/str_asr.o \
meta/zwdsp.o \
meta/gca.o \
meta/ish_isd.o \
meta/spt_spd.o \
meta/ydsp.o \
meta/gsp_gsb.o \
meta/ngc_ssm.o \
meta/msvp.o \
meta/ps2_joe.o \
meta/vgs.o \
meta/vs.o \
meta/dc_dcsw_dcs.o \
meta/wii_smp.o \
meta/ss_stream.o \
meta/emff.o \
meta/thp.o \
meta/wii_sts.o \
meta/capdsp.o \
meta/wii_sng.o \
meta/aax.o \
meta/ps2_p2bt.o \
meta/ps2_gbts.o \
meta/ngc_ffcc_str.o \
meta/sat_baka.o \
meta/nds_swav.o \
meta/vsf.o \
meta/nds_rrds.o \
meta/ps2_tk5.o \
meta/ads.o \
meta/wii_str.o \
meta/zsd.o \
meta/ps2_mcg.o \
meta/redspark.o \
meta/ps2_vgs.o \
meta/ivaud.o \
meta/ps2_sps.o \
meta/nds_hwas.o \
meta/ngc_lps.o \
meta/ps2_snd.o \
meta/naomi_adpcm.o \
meta/sd9.o \
meta/2dx9.o \
meta/ngc_dsp_ygo.o \
meta/ps2_vgv.o \
meta/ngc_gcub.o \
meta/maxis_xa.o \
meta/ngc_sck_dsp.o \
meta/apple_caff.o \
meta/pc_mxst.o \
meta/pc_sob.o \
meta/exakt_sc.o \
meta/wii_bns.o \
meta/pona.o \
meta/xbox_hlwav.o \
meta/stx.o \
meta/ps2_stm.o \
meta/myspd.o \
meta/his.o \
meta/ps2_ast.o \
meta/dmsg_segh.o \
meta/ngc_dsp_konami.o \
meta/ps2_ster.o \
meta/ps2_wb.o \
meta/bnsf.o \
meta/s14_sss.o \
meta/ps2_gcm.o \
meta/ps2_smpl.o \
meta/ps2_msa.o \
meta/pc_smp.o \
meta/p3d.o \
meta/ps2_adsc.o \
meta/psx_str_mgav.o \
meta/ngc_bo2.o \
meta/ngc_dsp_mpds.o \
meta/ps2_khv.o \
meta/ps2_voi.o \
meta/dsp_sth_str.o \
meta/ps2_b1s.o \
meta/ps2_wad.o \
meta/ps2_voi.o \
meta/ps2_lpcm.o \
meta/ps2_adm.o \
meta/dsp_bdsp.o \
meta/ps2_vms.o \
meta/ps2_xau.o \
meta/gh3_bar.o \
meta/ffw.o \
meta/ps2_jstm.o \
meta/ps3_xvag.o \
meta/ps3_cps.o \
meta/sqex_scd.o \
meta/ngc_nst_dsp.o \
meta/baf.o \
meta/ps3_msf.o \
meta/nub.o \
meta/ps3_past.o \
meta/ps3_sgh_sgb.o \
meta/ngca.o \
meta/wii_ras.o \
meta/ps2_spm.o \
meta/ps2_mtaf.o \
meta/x360_tra.o \
meta/ps2_iab.o \
meta/ps2_strlr.o \
meta/lsf.o \
meta/ps3_vawx.o \
meta/pc_snds.o \
meta/ps2_wmus.o \
meta/mattel_hyperscan.o \
meta/ios_psnd.o \
meta/pc_adp.o \
meta/excitebots.o \
meta/ps3_klbs.o \
meta/ps2_mtaf.o \
meta/tun.o \
meta/wpd.o \
meta/mn_str.o \
meta/ps2_mss.o \
meta/ps2_hsf.o \
meta/ps3_ivag.o \
meta/ps2_2pfs.o \
meta/ubi_ckd.o \
meta/ps2_vbk.o \
meta/otm.o \
meta/bcstm.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
libvgmstream.a: $(OBJECTS)
$(AR) crs libvgmstream.a $(OBJECTS)
vgmstream-deps:
$(CC) $(CFLAGS) -M -o vgmstream-deps
clean:
rm -f $(OBJECTS) libvgmstream.a
meta/bcstm.o \
meta/bfwav.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
libvgmstream.a: $(OBJECTS)
$(AR) crs libvgmstream.a $(OBJECTS)
vgmstream-deps:
$(CC) $(CFLAGS) -M -o vgmstream-deps
clean:
rm -f $(OBJECTS) libvgmstream.a

169
src/meta/bfwav.c Normal file
View File

@ -0,0 +1,169 @@
#include "meta.h"
#include "../util.h"
VGMSTREAM * init_vgmstream_bfwav(STREAMFILE *streamFile) {
VGMSTREAM * vgmstream = NULL;
char filename[260];
coding_t coding_type;
int big_endian = 1;
int ima = 0;
int32_t(*read_32bit)(off_t, STREAMFILE*) = NULL;
int16_t(*read_16bit)(off_t, STREAMFILE*) = NULL;
read_16bit = read_16bitBE;
read_32bit = read_32bitBE;
off_t head_offset;
off_t seek_offset;
int codec_number;
int channel_count;
int loop_flag;
off_t start_offset;
/* check extension, case insensitive */
streamFile->get_name(streamFile, filename, sizeof(filename));
if (strcasecmp("bfwav", filename_extension(filename)))
goto fail;
/* check header */
if ((uint32_t)read_32bitBE(0, streamFile) != 0x46574156) /* "FWAV" */
goto fail;
if ((uint32_t)read_32bitBE(4, streamFile) != 0xFEFF0040) /* "FWAV" */
goto fail;
/* get head offset, check */
if (big_endian)
head_offset = read_32bit(0x18, streamFile);
if ((uint32_t)read_32bitBE(head_offset, streamFile) != 0x494E464F) /* "INFO" (FWAV)*/
goto fail;
/* check type details */
codec_number = read_8bit(head_offset + 0x8, streamFile);
loop_flag = read_8bit(head_offset + 0x9, streamFile);
channel_count = read_8bit(head_offset + 0x1F, streamFile);
switch (codec_number) {
case 0:
coding_type = coding_PCM8;
break;
case 1:
if (big_endian)
coding_type = coding_PCM16BE;
else
coding_type = coding_PCM16LE;
break;
case 2:
coding_type = coding_NGC_DSP;
break;
default:
goto fail;
}
if (channel_count < 1) 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_32bit(head_offset + 0x14, streamFile);
vgmstream->sample_rate = (uint16_t)read_16bit(head_offset + 0xE, streamFile);
/* channels and loop flag are set by allocate_vgmstream */
vgmstream->loop_start_sample = read_32bit(head_offset + 0x10, streamFile);
vgmstream->loop_end_sample = vgmstream->num_samples;
vgmstream->coding_type = coding_type;
if (channel_count == 1)
vgmstream->layout_type = layout_none;
else
{
if (ima)
vgmstream->layout_type = layout_interleave;
else
vgmstream->layout_type = layout_interleave_shortblock;
}
if (big_endian)
vgmstream->meta_type = meta_FWAV;
if (big_endian)
{
// vgmstream->interleave_block_size = read_32bit(head_offset + 0x38, streamFile);
// vgmstream->interleave_smallblock_size = read_32bit(head_offset + 0x48, streamFile);
vgmstream->interleave_block_size = 0x200;
vgmstream->interleave_smallblock_size = 0x20;
}
if (big_endian)
start_offset = read_32bitBE(0x24, streamFile) + 0x20;
if (vgmstream->coding_type == coding_NGC_DSP) {
off_t coef_offset;
off_t coef_offset1;
off_t coef_offset2;
int coef_spacing;
int i, j;
coef_spacing = 0x2E;
off_t coeffheader = head_offset + 0x28;
int foundcoef = 0;
while (!(foundcoef))
{
if ((uint32_t)read_32bit(coeffheader, streamFile) == 0x1F000000)
{
coef_offset = read_32bit(coeffheader + 0xC, streamFile) + coeffheader;
foundcoef = 1;
break;
}
coeffheader++;
}
for (j = 0; j<vgmstream->channels; j++) {
for (i = 0; i<16; i++) {
vgmstream->ch[j].adpcm_coef[i] = read_16bit(coef_offset + j*coef_spacing + i * 2, streamFile);
}
}
}
/* open the file for reading by each channel */
{
int i;
for (i = 0; i<channel_count; i++) {
if (vgmstream->layout_type == layout_interleave_shortblock)
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
vgmstream->interleave_block_size);
else if (vgmstream->layout_type == layout_interleave)
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
STREAMFILE_DEFAULT_BUFFER_SIZE);
else
vgmstream->ch[i].streamfile = streamFile->open(streamFile, filename,
0x1000);
if (!vgmstream->ch[i].streamfile) goto fail;
vgmstream->ch[i].channel_start_offset =
vgmstream->ch[i].offset =
start_offset + i*vgmstream->interleave_block_size;
}
}
return vgmstream;
/* clean up anything we may have opened */
fail:
if (vgmstream) close_vgmstream(vgmstream);
return NULL;
}

View File

@ -632,4 +632,6 @@ VGMSTREAM * init_vgmstream_otm(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_bcstm(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_bfwav(STREAMFILE* streamFile);
#endif

View File

@ -17,6 +17,7 @@
VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_adx,
init_vgmstream_brstm,
init_vgmstream_bfwav,
init_vgmstream_nds_strm,
init_vgmstream_agsc,
init_vgmstream_ngc_adpdtk,

View File

@ -240,7 +240,8 @@ typedef enum {
meta_RWSD, /* single-stream RWSD */
meta_RWAR, /* single-stream RWAR */
meta_RWAV, /* contents of RWAR */
meta_CWAV, /* */
meta_CWAV, /* contents of CWAR */
meta_FWAV /* contents of FWAR */
meta_RSTM_SPM, /* RSTM with 44->22khz hack */
meta_THP,
meta_RSTM_shrunken, /* Atlus' mutant shortened RSTM */

View File

@ -44,6 +44,7 @@ gchar *vgmstream_exts [] = {
"bar",
"bcstm",
"bcwav",
"bfwav",
"bg00",
"bgw",
"bh2pcm",

View File

@ -109,6 +109,7 @@ char * extension_list[] = {
"bcstm\0BCSTM Audio File (*.BCSTM)\0",
"bcwav\0BCWAV (*.BCWAV)\0",
"bdsp\0BDSP Audio File (*.BDSP)\0",
"bfwav\0BFWAV Audio File (*.BFWAV)\0",
"bg00\0BG00 Audio File (*.BG00)\0",
"bgw\0BGW Audio File (*.BGW)\0",
"bh2pcm\0BH2PCM Audio File (*.BH2PCM)\0",