Is it possible to play the same audio file in multiple cards, subject to different timestamps in each card

Is it possible to play the same audio file in multiple cards, subject to different timestamps contained in the respective fields in each card.

I tried to use Audio control along with the script mentioned in the below discussion, but the audio control based on a card FIELD is not working.

My current Anki version is:
Version 2.1.35 (84dcaa86)
Python 3.8.0 Qt 5.14.2 PyQt 5.14.2

I have now tested the script on Anki 2.1.47 and AnkiDroid 2.15.6, and it works for me on both.

The script requires at least version 2.1.36 to work on Anki desktop, as stated in the comments of the script. Also, please make sure to check the following:

  • Disable "Don't play audio automatically" in the deck option.
  • Uncomment myAudio.play(); at the last line of the script. (That is, delete // at the beginning of the line.)

Thanks hkr for your quick response:
Now i have done the below things

  1. upgraded the anki desktop on mac to Version ⁨2.1.47
  2. Disabled "Don't play audio automatically" in the deck option.
  3. Uncommented myAudio.play(); at the last line of the script. (That is, delete // at the beginning of the line.

Still the audio control itself is greyed out, as you can see in the attached screenshot.

In the above screenshot, the code that i have put is also visible. I am not sure why audit control (the button visible on the screenshot) is not working for me. It could be possible that I am committing some overlook.

It might be that the audio file in collection.media does not match the file name you entered in audio_file field. I have uploaded a sample deck so you can try it out.

2 Likes

Thank you. It is a perfect solution :smile: .

In the field “audio_file”, I was having file name as [sound:file_name] similar to other types of decks, however here for this solution, just file_name is needed (without the brackets, sound, : etc.). I was not aware of it. Thank you.

1 Like