vgmstream/src/meta/tgc.c

31 lines
752 B
C
Raw Normal View History

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;
2020-01-12 08:00:44 +01:00
vgmstream->num_samples = ((uint16_t)read_16bitBE(1, streamFile) - 3) * 2;
2020-01-11 12:33:27 +01:00
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-12 08:00:44 +01:00
}