How to play a sound after it stops at its set 'stop time' ? #463
Unanswered
ahmadharis4u
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
There's a possible bug here. I'm going to try replicating this and get back to you. |
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.
-
Scenario:
I initialized a sound and set it to play for 10s by doing this:
ma_result result = ma_sound_init_from_file(&m_engine, m_stFileName.c_str(), MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC, NULL, NULL, &m_sound);if (result == MA_SUCCESS){ma_sound_set_stop_time_in_pcm_frames(&m_sound, ma_engine_get_time(&m_engine) + (ma_engine_get_sample_rate(&m_engine) * 10));result = ma_sound_start(&m_sound);}This plays the sound for 10s and stops.
But when I try to play it again by calling only
result = ma_sound_start(&m_sound);nothing plays, even though result is success.
I tried to call
result = ma_sound_seek_to_pcm_frame(&m_sound, 0);before the ma_sound_start call, but this doesn't work as well.
Question:
How do I reset the stop time of the sound, so that it starts playing again after seek to 0.
I hope my question is clear.
Beta Was this translation helpful? Give feedback.
All reactions