bool WaveDecoder::rewind() { int wuff_status = wuff_seek(handle, 0); if (wuff_status >= 0) { eof = false; return true; } return false; }
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; }
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; }