#include "tn_sndfile.h"

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

int32 TNPlug_SeekPlayer (struct TNPlugIFace *Self, struct TuneNet *inTuneNet, uint32 seconds) {
	struct TNDecHandle *handle = inTuneNet->handle;
	sf_count_t res;
	res = sf_seek(handle->file, seconds * handle->info.samplerate, SEEK_SET);
	return res;
}
