Codec for Fmod Ex, http://www.fmod.org/

codec_game.dll
Ver. 1.22
by Andreas Argirakis 2008.
Visit http://andreas.blazer.nu for latest version
Built with Game_Music_Emu, http://www.slack.net/~ant/libs/audio.html

Plays the following formats:

AY - ZX Spectrum, Amstrad CPC
GBS - Nintendo Game Boy
GYM - Sega Genesis, Mega Drive
HES - NEC TurboGrafx-16, PC Engine
KSS - MSX Home Computer, other Z80 systems (doesn't support FM sound)
NSF, NSFE - Nintendo NES, Famicom (with VRC 6, Namco 106, and FME-7 sound)
SAP - Atari systems using POKEY sound chip
SPC - Super Nintendo, Super Famicom
VGM, VGZ - Sega Master System, Mark III, Sega Genesis, Mega Drive, BBC Micro


Usage:

You have to

#define FMOD_TIMEUNIT_SUBSONG			0x20000000

you can put it in fmod.h for example

put codec_game.dll in the same directory as your fmod-dll.
To load the plugin in C/c++ code:
system->loadPlugin("codec_game.dll", 0, 0);

Then load and play file as usual.

To select a subsong you do like this:

fmod_channel->setPosition(x, FMOD_TIMEUNIT_SUBSONG)

where x is the number of the subsong.

Use

fmod_sound getLength(&subsongs, FMOD_TIMEUNIT_SUBSONG );

to get the number of subsongs in the track

Use

fmod_sound getposition(&subsongs, FMOD_TIMEUNIT_SUBSONG );

to get the current subsong


If you find any bugs etc. contact me at andreas@blazer.nu

1.22 Unable to start subsong 0, except from when loading the sound

1.21 Defined FMOD_TIMEUNIT_SUBSONG to handle subsongs and some better error checking

1.2 Subsongs bug fixed
    Supports seeking in songs

1.1 Fixes just some minor things.