Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Audio not playing in Twine 2 (Sugarcube 2), no errors thrown

Hey everyone,

I'm trying to get audio playing using Twine 2, using the Sugarcube 2 story format. I've got all my code in place, but no audio is playing and there's no error being thrown. Its probably a typically stupid blind noob error I'm making, but here we go.

Just to clarify, I'm testing my audio in my story using "Publish to File" and opening it in Firefox, because I'm using the desktop version of Twine 2. The audio is stored in .mp3 form upon Dropbox in a publicly accessible folder.

Anyway, this bit of code is stored in a passage I've named StoryInit, where I'm caching all my audio.

<<cacheaudio "youre a fool" "dropbox link here">>

And then later on I try to call it in a separate passage in my story using...

<<audio "youre a fool" play loop>>

It doesn't play. There's no errors. What could I possibly be doing wrong?


  • Without knowing more, I'm going to assume that it's probably the Dropbox URL. If it ends in dl=0, then you need to change that part to dl=1.

    The value of the dl query attribute determines whether Dropbox serves up the file's landing page or the file itself—a value of 0 gets the landing page, while 1 gets the file.
  • edited April 2016
    I just gave that a try, and now my story throws up "Error: <<audio>>: no track by ID:" when I get to the page where I want the audio to be triggered.

    The file name is the same as everything I'm referencing in my story, so I'm not sure what the error means.
  • Hmm. Looks into the problem. Ah. That's a bug. I find it hard to believe that no one's run into that before.

    Until I can get a fix out, you may use the following workaround. Append the following query attribute to your Dropbox URLs.
    Where {FILE_EXTENSION} is the period-prefixed extension of the file in question. For example:
    → For MP3s, append the following:
    → For OGGs, append the following:
    → For WAVs, append the following:
    → For WEBMs, append the following:
    You get the idea. Just make sure to append it to the URL, it must come last.

    So, with the dl query attribute change, and using the following URL as an example:
    → A Dropbox URL that ends like this:
    → Should look like this instead:
  • Wahey, it works now!

    Pretty cool that I managed to find a bug, but also a bit frustrating trying to overcome it on my own for so long, haha. Glad I came here.

    Thanks for the help.
  • I know this thread is old, but i just ran into this bug as well. Anybody ever find a solution? I tried MadExile's solution and it worked for some sound files and not others.
Sign In or Register to comment.