Hello again guys I was just curious how does one go about adding sound such as an mp3 file to their twine story?
Additionally, is it possible to have one track repeat throughout the length of the story and only stop when invoked to do so?
Importing an image was pretty simple to figure out but something tells me sound maybe a bit more complex.
Thanks!
Comments
Suggestion: instead of patching Sugarcube with that script from 2013, install SugarCube. It has built-in audio functionality.
About the sugarcube, I've finished writing most of the functionality into my story. Would the sugarcane 1.42 syntax such as if statements and logic comparisons transfer over to sugarcube or would I have to rewrite them?
I'm putting together something in Twine at the moment for a uni project and I was going to add some background audio to one of the passages, I can cut it out but it'd be a shame to do so if adding audio isn't actually that complicated.
The only change to those instructions I would suggest is to download SugarCube 2 instead.
You don't need to add the Glorious Train Wrecks script to SugarCube because it has it's own Audio macros built in. (v2 docs and v1 docs)
In regards to where to place your sound files, that depends on if you are going to host your story HTML file on a web-server or if you are going to put your story HTML file on a file download site like Google Docs or Mega.
If you are hosting then you will need to also host your sound files on the same web-server. If you are going to use file download site then you could place your sound files in the same folder as your story HTML file and use a tool like ZIP to create an archive file containing your story html file as well as your sound files.
I put this into my StoryInit: <<cacheaudio "boom" "media/audio/explosion.mp3">> as told – switching out that info for the file I'm using and it's location but...nothing but an error message.
I'm sure I'm missing something obvious but the truth is I'm just not that computer literate, so the things I'm being asked to do often just don't make sense to me.
As an example, for a relative path like the following: Your directory structure, relative to the compiled HTML file, should look something like this:
Besides it's really annoying typing out long structures whenever you want to input a file.