Turbo Play Audio Collection File Format (TPW)


TPW is an audio container, with channels compressed or uncompressed. Unlike WAV or MP3 (see FileTypes) , TPW can contain an unlimited number of channels and the sizes of the channels are not necessarily the same.

TPW files start with a header:

 

#pragma pack(1)
struct TPW_HEADER
{
unsigned __int32 hdr; // 0x00545057 "TPW"
unsigned __int32 ver; // 1
unsigned __int32 nCh; // # of channels
WAVEFORMATEX wfx; // Compression, extra data follows
};

After this header, the number of extra bytes (specified in the wfx) are written.

After the extra bytes, if any, there are tags. A Tag consists of a 64-bit value for its ID, a 64-bit value of its size, and the data it contains.

Here are the defined tags:

#define TPX_TAG_DATA_ID 0
struct TPX_TAG_DATA
	{
	unsigned __int64 TagID; // 0
	unsigned __int64 TagSize; 
	// Data follows
	};


#define TPX_TAG_TRACKNAMES_ID 1
struct TPX_TAG_TRACKNAMES
{
unsigned __int64 TagID; // 1
unsigned __int64 TagSize;
// Following string names, <string>\0<string>\0 ... \0\0 , strings are UTF-8
};
#define TPX_TAG_SIZES_ID 2
struct TPX_TAG_SIZES
{
unsigned __int64 TagID; // 2
unsigned __int64 TagSize;
// Sizes follow, 64-bit each
};

 

 

To import a TPW file therefore, an application has to: