Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop Issue #27

Open
owllyi opened this issue May 29, 2023 · 1 comment
Open

Loop Issue #27

owllyi opened this issue May 29, 2023 · 1 comment

Comments

@owllyi
Copy link

owllyi commented May 29, 2023

The clip loop is not working, and I suspect it's because the playbackFinishedTimer.Interval setting causes HandleFinishedPlayback to be called. I modified the code so that when looping, Enabled = false, but this still didn't solve the problem. I'd like to ask if anyone has encountered a similar issue and how to make the clip loop play properly?

@owllyi
Copy link
Author

owllyi commented May 29, 2023

        if (remainingPlayDuration > 0.0f)
        {
            if (isPlaybackLooping)
            {
                // Disable timer when looping
                playbackFinishedTimer.Enabled = false;
            }
            else
            {
                // Set Enabled last, Interval will update timer
                playbackFinishedTimer.Interval = remainingPlayDuration * 1000;
                playbackFinishedTimer.AutoReset = false;
                playbackFinishedTimer.Enabled = true;
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant