#include "tn_acm.h"

int32 TNPlug_DecodeFramePlayer (struct TNPlugIFace *Self, struct TuneNet *inTuneNet,
	int16 *outbuffer)
{
	struct TNDecHandle *handle = inTuneNet->handle;
	int16 *pcm = inTuneNet->pcm[0];
	int32 bytes;

	bytes = acm_read(handle->acm, (char *)pcm, handle->pcm_size, 1, 2, 1);
	return (bytes >> 1) / inTuneNet->dec_channels;
}

int32 TNPlug_SeekPlayer (struct TNPlugIFace *Self, struct TuneNet *inTuneNet, uint32 seconds) {
	struct TNDecHandle *handle = inTuneNet->handle;
	acm_seek_time(handle->acm, seconds * 1000);
	return seconds;
}
