示例#1
0
bool WaveDecoder::rewind()
{
	int wuff_status = wuff_seek(handle, 0);

	if (wuff_status >= 0)
	{
		eof = false;
		return true;
	}

	return false;
}
示例#2
0
bool WaveDecoder::seek(float s)
{
	int wuff_status = wuff_seek(handle, (wuff_uint64) (s * info.sample_rate));

	if (wuff_status >= 0)
	{
		eof = false;
		return true;
	}

	return false;
}
示例#3
0
wuff_sint32 wuff_format(struct wuff_handle * handle, wuff_uint16 format)
{
	wuff_sint32 wuff_status;

	if (handle == NULL)
		return WUFF_INVALID_PARAM;
	else if (format >= WUFF_FORMAT_MAX)
		return WUFF_FORMAT_UNSUPPORTED;

	/* A format change resets the position to the start of the block. */
	wuff_status = wuff_seek(handle, handle->stream.position);
	WUFF_STATUS_BAIL()

	wuff_status = wuff_set_output_format(handle, format);
	WUFF_STATUS_BAIL()

	return WUFF_SUCCESS;
}