forked from vgmstream/vgmstream
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
92 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "meta.h" | ||
#include "../coding/coding.h" | ||
|
||
|
||
/* !B0X - Traveller's Tales speech files [Lego Batman 2 (PC), Lego Dimensions (PS3)] */ | ||
VGMSTREAM* init_vgmstream_cbx(STREAMFILE* sf) { | ||
VGMSTREAM* vgmstream = NULL; | ||
uint32_t start_offset, pcm_size; | ||
int loop_flag, channels, sample_rate; | ||
|
||
|
||
/* checks */ | ||
if (!is_id32be(0x00,sf, "!B0X")) | ||
return NULL; | ||
if (!check_extensions(sf, "cbx")) | ||
return NULL; | ||
|
||
/* debug strings identify this as "Chatterbox"/"CBOX"/"CBX", while sound lib seems called "NuSound" | ||
* (probably based on .utk) */ | ||
|
||
pcm_size = read_u32le(0x04, sf); | ||
sample_rate = read_s32le(0x08, sf); | ||
start_offset = 0x0c; | ||
channels = 1; | ||
loop_flag = 0; | ||
|
||
|
||
/* build the VGMSTREAM */ | ||
vgmstream = allocate_vgmstream(channels, loop_flag); | ||
if (!vgmstream) goto fail; | ||
|
||
vgmstream->meta_type = meta_CBX; | ||
vgmstream->sample_rate = sample_rate; | ||
vgmstream->num_samples = pcm_size / 2; | ||
vgmstream->coding_type = coding_EA_MT; | ||
vgmstream->layout_type = layout_none; | ||
vgmstream->codec_data = init_ea_mt_cbx(vgmstream->channels); | ||
if (!vgmstream->codec_data) goto fail; | ||
|
||
if (!vgmstream_open_stream(vgmstream, sf, start_offset)) | ||
goto fail; | ||
return vgmstream; | ||
fail: | ||
close_vgmstream(vgmstream); | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -703,6 +703,7 @@ typedef enum { | |
meta_SNDS, | ||
meta_NXOF, | ||
meta_GWB_GWD, | ||
meta_CBX, | ||
|
||
} meta_t; | ||
|
||
|