diff --git a/src/Makefile b/src/Makefile
index da59dfd4..61fd62ad 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -213,7 +213,8 @@ META_OBJS=meta/adx_header.o \
meta/wii_bns.o \
meta/wii_was.o \
meta/pona.o \
- meta/fsb_test.o
+ meta/fsb_test.o \
+ meta/xbox_hlwav.o
OBJECTS=vgmstream.o streamfile.o util.o $(CODING_OBJS) $(LAYOUT_OBJS) $(META_OBJS)
diff --git a/src/libvgmstream.vcproj b/src/libvgmstream.vcproj
index a1d6dca3..58df0551 100644
--- a/src/libvgmstream.vcproj
+++ b/src/libvgmstream.vcproj
@@ -838,6 +838,10 @@
RelativePath=".\meta\wvs.c"
>
+
+
diff --git a/src/meta/Makefile.unix.am b/src/meta/Makefile.unix.am
index 8a85b546..fc935f1b 100644
--- a/src/meta/Makefile.unix.am
+++ b/src/meta/Makefile.unix.am
@@ -171,5 +171,6 @@ libmeta_la_SOURCES += wii_bns.c
libmeta_la_SOURCES += wii_was.c
libmeta_la_SOURCES += pona.c
libmeta_la_SOURCES += fsb_test.c
+libmeta_la_SOURCES += xbox_hlwav.c
EXTRA_DIST = meta.h
diff --git a/src/meta/meta.h b/src/meta/meta.h
index 80afecd1..49a436a0 100644
--- a/src/meta/meta.h
+++ b/src/meta/meta.h
@@ -421,4 +421,6 @@ VGMSTREAM * init_vgmstream_wii_was(STREAMFILE* streamFile);
VGMSTREAM * init_vgmstream_pona(STREAMFILE* streamFile);
+VGMSTREAM * init_vgmstream_xbox_hlwav(STREAMFILE* streamFile);
+
#endif
diff --git a/src/meta/xbox_hlwav.c b/src/meta/xbox_hlwav.c
new file mode 100644
index 00000000..51131974
--- /dev/null
+++ b/src/meta/xbox_hlwav.c
@@ -0,0 +1,64 @@
+#include "meta.h"
+#include "../util.h"
+
+/* HLWAV (from Half Life 2 [XBOX]) */
+VGMSTREAM * init_vgmstream_xbox_hlwav(STREAMFILE *streamFile) {
+ VGMSTREAM * vgmstream = NULL;
+ char filename[260];
+ off_t start_offset;
+ int loop_flag;
+ int channel_count;
+
+ /* check extension, case insensitive */
+ streamFile->get_name(streamFile,filename,sizeof(filename));
+ if (strcasecmp("hlwav",filename_extension(filename))) goto fail;
+
+ /* check header and size */
+ if ((read_32bitBE(0x00,streamFile) != 0x14000000)) goto fail;
+ if (((read_32bitLE(0x4,streamFile) + (read_32bitLE(0x8,streamFile))) != get_streamfile_size(streamFile))) goto fail;
+
+ loop_flag = (read_32bitLE(0xC,streamFile)!= 0xFFFFFFFF);
+ channel_count = 2;
+
+ /* build the VGMSTREAM */
+ vgmstream = allocate_vgmstream(channel_count,loop_flag);
+ if (!vgmstream) goto fail;
+
+ /* fill in the vital statistics */
+ start_offset = read_32bitLE(0x8,streamFile);
+ vgmstream->channels = channel_count;
+ vgmstream->sample_rate = 22050;
+ vgmstream->coding_type = coding_PCM16LE;
+ vgmstream->num_samples = read_32bitLE(0x4,streamFile)/2/channel_count;
+ if (loop_flag) {
+ vgmstream->loop_start_sample = read_32bitLE(0x4,streamFile)/2/channel_count;
+ vgmstream->loop_end_sample = read_32bitLE(0xC,streamFile)/2/channel_count;
+ }
+
+ vgmstream->layout_type = layout_interleave;
+ vgmstream->interleave_block_size = 0x2;
+ vgmstream->meta_type = meta_XBOX_HLWAV;
+
+ /* open the file for reading */
+ {
+ int i;
+ STREAMFILE * file;
+ file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE);
+ if (!file) goto fail;
+ for (i=0;ich[i].streamfile = file;
+
+ vgmstream->ch[i].channel_start_offset=
+ vgmstream->ch[i].offset=start_offset+
+ vgmstream->interleave_block_size*i;
+
+ }
+ }
+
+ return vgmstream;
+
+ /* clean up anything we may have opened */
+fail:
+ if (vgmstream) close_vgmstream(vgmstream);
+ return NULL;
+}
diff --git a/src/vgmstream.c b/src/vgmstream.c
index cbb6c806..aecb2f8a 100644
--- a/src/vgmstream.c
+++ b/src/vgmstream.c
@@ -231,6 +231,7 @@ VGMSTREAM * (*init_vgmstream_fcns[])(STREAMFILE *streamFile) = {
init_vgmstream_wii_bns,
init_vgmstream_wii_was,
init_vgmstream_pona,
+ init_vgmstream_xbox_hlwav,
};
#define INIT_VGMSTREAM_FCNS (sizeof(init_vgmstream_fcns)/sizeof(init_vgmstream_fcns[0]))
@@ -2336,6 +2337,9 @@ void describe_vgmstream(VGMSTREAM * vgmstream, char * desc, int length) {
case meta_WII_WAS:
snprintf(temp,TEMPSIZE,"DiRT2 WAS header");
break;
+ case meta_XBOX_HLWAV:
+ snprintf(temp,TEMPSIZE,"Half Life 2 bgm header");
+ break;
default:
snprintf(temp,TEMPSIZE,"THEY SHOULD HAVE SENT A POET");
}
diff --git a/src/vgmstream.h b/src/vgmstream.h
index 9ffafd5e..e84c0ae0 100644
--- a/src/vgmstream.h
+++ b/src/vgmstream.h
@@ -418,6 +418,7 @@ typedef enum {
meta_EXAKT_SC, /* Activision EXAKT .SC (PS2) */
meta_WII_WAS, /* DiRT 2 (WII) */
meta_PONA, /* Policenauts (3DO + PSX) */
+ meta_XBOX_HLWAV, /* Half Life 2 (XBOX) */
} meta_t;
typedef struct {
diff --git a/winamp/in_vgmstream.c b/winamp/in_vgmstream.c
index 1eac321a..e1b090d5 100644
--- a/winamp/in_vgmstream.c
+++ b/winamp/in_vgmstream.c
@@ -141,6 +141,7 @@ char * extension_list[] = {
"gsb\0GSB Audio File (*.GSB)\0",
"hgc1\0HGC1 Audio File (*.HGC1)\0",
+ "hlwav\0HLWAV Audio File (*.HLWAV)\0",
"hps\0HALPST Audio File (*.HPS)\0",
"hwas\0HWAS Audio File (*.HWAS)\0",