2020-01-11 11:52:24 +01:00
|
|
|
#include "meta.h"
|
|
|
|
#include "../coding/coding.h"
|
|
|
|
|
|
|
|
/* Tiger Game.com ADPCM file */
|
|
|
|
VGMSTREAM * init_vgmstream_tgc(STREAMFILE *streamFile) {
|
2020-01-11 12:33:27 +01:00
|
|
|
VGMSTREAM * vgmstream = NULL;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
2020-01-11 12:33:27 +01:00
|
|
|
/* checks */
|
2020-01-11 15:40:05 +01:00
|
|
|
if (!check_extensions(streamFile, "4"))
|
2020-01-11 12:33:27 +01:00
|
|
|
goto fail;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
2020-01-11 12:33:27 +01:00
|
|
|
/* build the VGMSTREAM */
|
|
|
|
vgmstream = allocate_vgmstream(1, 0);
|
|
|
|
if (!vgmstream) goto fail;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
2020-01-11 12:33:27 +01:00
|
|
|
vgmstream->sample_rate = 8000;
|
|
|
|
vgmstream->num_samples = (read_16bitBE(1, streamFile) - 3) * 2;
|
|
|
|
vgmstream->meta_type = meta_TGC;
|
|
|
|
vgmstream->layout_type = layout_none;
|
|
|
|
vgmstream->coding_type = coding_TGC;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
2020-01-11 12:33:27 +01:00
|
|
|
if (!vgmstream_open_stream(vgmstream, streamFile, 3))
|
|
|
|
goto fail;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
2020-01-11 12:33:27 +01:00
|
|
|
return vgmstream;
|
2020-01-11 11:52:24 +01:00
|
|
|
|
|
|
|
fail:
|
2020-01-11 12:33:27 +01:00
|
|
|
close_vgmstream(vgmstream);
|
|
|
|
return NULL;
|
2020-01-11 11:52:24 +01:00
|
|
|
}
|