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

Fixed a bug where the alarm wouldnt stop, even after answering the card. #22

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pedro-volpi
Copy link

Description

The default audio for Speed Focus Mode addon is very short. Trying out larger files, a problem arises: the audio keeps playing for a while, even after you have pressed any of the buttons (e.g. again, etc).

The problema was the play() function from the anki.sound package. The fix is simple: replace the play() function with an AVPlayer instance (which is what 'play' calls) and call its stop_and_clear_queue() method when the question timeouts are cleared (i.e. inside clearQuestionTimeouts).

Checklist:

Please replace the space inside the brackets with an x and fill out the ellipses if the following items apply:

  • I've read and understood the contribution guidelines
  • I've tested my changes against at least one of the following Anki builds:
    • Latest standard Anki 2.1 binary build [required for Anki-compatible 2.1 add-ons]
    • Latest alternative Anki 2.1 binary build
    • Latest Anki 2.0 binary build [required for Anki 2.0-compatible add-ons]
  • I've tested my changes on at least one of the following platforms:
    • Linux, version:
    • Windows, version: 10
    • macOS, version:
  • My changes potentially affect non-desktop platforms, of which I've tested:
    • AnkiMobile, version:
    • AnkiDroid, version:
    • AnkiWeb

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

Successfully merging this pull request may close these issues.

1 participant