How to seek ahead (or back) by a given time (say 10s) while playback? #457
ahmadharis4u
started this conversation in
General
Replies: 1 comment 3 replies
-
|
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
There is an API to seek number of frames, but no api to get the current frame.
How to skip the playback ahead or behind by a given time?
I tried below code for 'Forward by 10s' :
ma_uint64 nFrameCount = ma_decoder_get_length_in_pcm_frames(&m_decoder);
ma_uint64 nFrameIndex = m_nTotalFramesRead + (m_decoder.outputSampleRate * 10);
if (nFrameIndex <= nFrameCount)
ma_decoder_seek_to_pcm_frame(&m_decoder, nFrameIndex);
but I could not get m_nTotalFramesRead correctly, so this formula did not work
Please help.
Beta Was this translation helpful? Give feedback.
All reactions