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

Doesn't work with 2.1.20 #1

Open
rishifter opened this issue Feb 14, 2020 · 10 comments
Open

Doesn't work with 2.1.20 #1

rishifter opened this issue Feb 14, 2020 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@rishifter
Copy link

No sound plays at all.

@khonkhortisan
Copy link
Owner

khonkhortisan commented Feb 20, 2020

If I raise ValueError('ease == 3 play called') right after the play() it makes the sound once, it's broken because clearAudioQueue() moved from Review.nextCard so it could still be called.
(A workaround would be to, every card, re-register the hook, error out to delete the hook and play the sound, and make the user close the error pop-up.)

@khonkhortisan
Copy link
Owner

khonkhortisan commented Feb 20, 2020

AKA avplayer.stop_and_clear_queue() which is called from
[irrelevant] qt/aqt/addcards.py AddCard._addCards AddCards._reject
qt/aqt/sound.py AVPlayer.stop_and_clear_queue AVPlayer.shutdown clearAudioQueue
[irrelevant] qt/aqt/overview.py Overview.show
[irrelevant] qt/aqt/deckbrowser.py DeckBrowswer.show
qt/aqt/clayout.py CardLayout.reject
...
This all has something to do with
Tools→Preferences→Basic→☑ Interrupt current audio when answering. Disabling that makes the sound work if there's nothing already playing when you answer. [I had clearAudioQueue commented out at the time of writing this]
So the same as when I first wrote this: I need to interrupt the audio myself, and tell Anki not to. Or play it on another thread.

@khonkhortisan
Copy link
Owner

AVPlayer.play_tags gets called on the front and back of the card, and I want to disable interrupt_current_audio on the front of the card so my sound plays, but leave it at the user setting for the back of the card so this addon doesn't have side effects. 😕

@khonkhortisan khonkhortisan added this to the 2.1.20 milestone Feb 20, 2020
@khonkhortisan khonkhortisan added the bug Something isn't working label Feb 20, 2020
@khonkhortisan
Copy link
Owner

Uploaded a version that plays sounds but leaks front side audio to the back side. 383abaf

@Duytrungnuce
Copy link

Vere helpful, but not working in Version 2.1.20 (47a1bf8b)

@75462565374252
Copy link

Anxiously waiting for this to be fixed. I need my review sounds. Thanks.

@75462565374252
Copy link

Uploaded a version that plays sounds but leaks front side audio to the back side. 383abaf

Can't get this to work either. So sad

@75462565374252
Copy link

Anki 2.1.21 changelog:

Fixed error messages when playing audio.
Display a more useful message when mpv/mplayer not installed.
Fixed interrupting of current audio when autoplay is turned off.

Add-on is still not working for me. Regular version plays no sound; version linked in previous post gives me:

When loading 'Answer Button Sounds':
Traceback (most recent call last):
File "aqt/addons.py", line 205, in loadAddons
File "/Users/jonas/Library/Application Support/Anki2/addons21/679615590/init.py", line 32, in
if LetSoundBleedOntoNextCard_InsteadOf_CancelingSoundEffectSometimes:
NameError: name 'LetSoundBleedOntoNextCard_InsteadOf_CancelingSoundEffectSometimes' is not defined

@rishifter
Copy link
Author

It works for me after checking "Interrupt current audio when answering" but after doing 100-150 reviews it stops for no reason.

@ghost
Copy link

ghost commented Mar 18, 2020

@khonkhortisan Hitmarkers seems to implement the audio correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants