Converting audio web links to audio files

I currently have inserted audio files into my cards via a web link…
I import my cards into anki via an excel csv (the audio web link is in the rightmost column)

and then I have formatted them to be a clickable link as such:
However, would there be a way to convert this url link into just straight audio, which plays as soon as the other side of the card is flipped ? (I downloaded another pre made deck that does this). Ideally without having to recreate / copy paste one by one etc.

Maybe something like this:

  1. Download audio files using curl, wget, aria2, etc.
  2. Move audio files to the folder
  3. Use Find and Replace to convert urls to [sound:audio.mp3]
  4. Run Tools > Check Media

  1. Download audio files

    For example, by using curl, wget or aria2 from the command line and a list of urls in a text file

    It might be also possible to use Chrome DevTools to automatically download audio files.

    1. Open Google Chrome, navigate to and open the Console panel

    2. Copypaste this code

      function save(data, filename){
          if (!data) {
              console.error('ERROR: no data')
          a = document.createElement('a');
 = filename;
          a.href = window.URL.createObjectURL(data);
          a.dataset.downloadurl = ['application/octet-stream',, a.href].join(':');
      function sleep(ms) {
          return new Promise(resolve => setTimeout(resolve, ms));
      URLS_TO_DOWNLOAD = URLS_TO_DOWNLOAD.trim().split('\n')
      for (let url of URLS_TO_DOWNLOAD) {
          await fetch(url).then((response) => {
              return response.blob();
          }).then(blob => {
              let filename = url.split('/').pop();
              save(blob, filename);
          }).catch((err) => {
              console.log('ERROR:', err);
          await sleep(1000);
    3. Replace URLS_TO_DOWNLOAD with new urls and press Enter to run it

    4. Agree to download multiple files


  2. Move audio files to the folder

  3. Use Find and Replace to convert mp3 urls to [sound:audio.mp3]

    Find: https?://.+?/([^ /]+\.mp3)
    Replace: [sound:${1}]
    Treat input as regular expression - Yes

  4. Run Tools > Check Media


Another option is to have [sound:http://…] on your cards, then use something like Localize Media - AnkiWeb


Thank you man this is an awesome solution - however only now it doesn’t play automatically when opening up if I use ankiweb or ankidroid (since the files are local files I guess)

Thank you, but I forgot about the Localize Media add-on, the add-on will also take care of possible duplicates with the same filename and should be more easy to use.

About AnkiWeb, I think it’s not possible due to the browser’s autoplay blocking policy.

About AnkiDroid, it should behave the same way as the desktop version, check the deck’s options - it’s accessible from the context menu (with a long tap) or from the overview screen.

By default, Anki automatically plays audio on the front and back of cards. If you check “Don’t play audio automatically”, Anki will not play audio …

Maybe also install the latest AnkiDroid version from GitHub (if you’re on 2.15.6 from Google Play that was last updated on Jul 14, 2021).

I think I’ve got it working now…I added another template field for the sound file, as well as keeping that URL link for ankiweb for when I use that.
Thank you for all your help on this .

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.