diff --git a/include/samplerate.h b/include/samplerate.h index a3d5ae1a..1bdab131 100644 --- a/include/samplerate.h +++ b/include/samplerate.h @@ -71,6 +71,14 @@ SRC_STATE* src_clone (SRC_STATE* orig, int *error) ; SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels, int *error, void* cb_data) ; + +/** + * Double-precision getters: Fractional used-frame + * tracking while using the callback API. + */ +double src_get_last_position(SRC_STATE* state); +double src_get_saved_frames(SRC_STATE* state); + /* ** Cleanup all internal allocations. ** Always returns NULL. diff --git a/src/samplerate.c b/src/samplerate.c index 6a51f279..c76a70ef 100644 --- a/src/samplerate.c +++ b/src/samplerate.c @@ -72,6 +72,15 @@ src_callback_new (src_callback_t func, int converter_type, int channels, int *er return state ; } /* src_callback_new */ + +double src_get_last_postion(SRC_STATE* state) { + return state->last_position; +} + +double src_get_saved_frames(SRC_STATE* state) { + return state->saved_frames; +} + SRC_STATE * src_delete (SRC_STATE *state) {