//--------------------------------------------------------------------------------------
// ADPCM/M44/P16 → WAV変換変換関数のヘッダー
//--------------------------------------------------------------------------------------

int		adpcmRateNo2Rate(int rateNo);
SLong	getAdpcm2pcmSize(SLong size);
SLong	adpcm2pcm(UByte *adpcmbuff,SLong size,UWord *pcmbuff);
int		writeWav2File(UByte *pcmbuff,SLong pcmsize,char *wavfname,int rate);
UByte	*adpcmFile2WavMem(char *adpcmfname,int rateNo,SLong *bufsize);
UByte 	*pcmFile2WavMem(char *pcmfname,int rate,int octave,int multiple,SLong *bufsize);

UByte	*storeWavHeader(UByte *pcmbuff,SLong pcmsize,ULong rate);

//--------------------------------------------------------------------------------------
// WAVヘッダー用構造体
// ARMは86と同じメモリ格納順なのでこれでいいが、68系では書き換える必要がある。

#pragma pack(push,2)
typedef struct {
	char	chunkID[4];
	SLong  	chunkSize;
	UByte	data[4];
} RIFF_WAVE_Chunk;
#pragma pack(pop)

#pragma pack(push,2)
typedef struct {
	char    chunkID[4];
	SLong   chunkSize;
	//
	SWord   wFormatTag;
	UWord 	wChannels;
	ULong 	dwSamplesPerSec;	// サンプリングレート
	ULong 	dwAvgBytesPerSec;
	UWord 	wBlockAlign;
	UWord 	wBitsPerSample;
	/* Note: there may be additional fields here, depending upon wFormatTag. */
} FormatChunk;
#pragma pack(pop)

#pragma pack(push,2)
typedef struct {
	char	chunkID[4];
	SLong	chunkSize;
	UByte	waveformData[0];
} DataChunk;
#pragma pack(pop)

//--------------------------------------------------------------------------------------
