Howdy, Stranger!

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

Cached Sound not working when published online

Hi All! I am very new at all of this so forgive my ignorance.

I am making a story on Sugarcube and have been using the Cached in storyinit to get sounds. When I publish to file and play it the sound works. But when I publish it online on Philomela it does not work.

Currently the sound source is in my desktop. I saw posts where people upload the sounds on dropbox or somewhere along those lines but I am confused as to how to code this..

Here's what mine looks like (sources are local)

<<cacheaudio "officesound" "sound/220373__psnflute1984__copy-machine-at-work.mp3">>

How can i code this if I were to have my files on dropbox.. or zip them.. any help will be appreciated.

Thanks

Comments

  • To access media files stored on a server (site) different than the one you're hosting your story HTML file on you will need to change the media URL from relative to absolute.

    This comment in the Twine 2.0/Harlowe Images and Dropbox thread explains how to obtain an URL to an image file stored on Dropbox, the same process can be used to obtain an URL for an audio file.

    That comment also explains how to setup a file structure to be transferred to a flash drive, that technique can also be used when creating a ZIP archive file. In your case the media sub-folder would be named sound.
  • Okay, so I am VERY NEW and the experts will be along soon with a proper answer, I'm sure, but if this helps ...

    I believe you'll need to have the audio with the story file and have the 'cache audio' macro point to where you're keeping it.

    So, if you are storing the story file and the audio file together in a Dropbox folder named 'Twine Stories', you will just need the macro to read:

    <<cacheaudio "soundname" "filename.mp3">>

    if you have it in a subfolder eg 'Twine Stories/Audio', you'd need it to read:

    <<cacheaudio "soundname" "audio/filename.mp3">>

    The macro just needs to point to whichever location it can access. When it's on your desktop, it can access locations on your desktop. If you're going to zip it and keep it in Dropbox, you need the file macro to point to wherever this new location is.

    I mean ... it looks like you're already doing this? Just make sure that if it's pointing to 'sound/filename.mp3' that when you store it in a new location, the audio is in a subfolder called 'sound'.

    Hope this helps and sorry if I've misunderstood!
  • You should always state the story format you're using and its version, because advice will tend to vary based on that information.

    What version—the full version—of SugarCube are you using?

    If you're using any version of SugarCube v2 ≥v2.6.0—current is v2.14.0—then you have no problems. That said, the latest release version is best as the audio subsystem received a significant upgrade in v2.8.0 and a few audio bugs were fixed in v2.12.0 and v2.12.1.

    If you're using SugarCube v1, then you have problems. If it's, specifically, any version prior to v1.0.35, then you're probably not going to be able to use Dropbox due to a bug. If it's the current release version, v1.0.35, then you may use Dropbox, Google Drive, or what have you—though you will need to use a simple workaround, due to v1's audio macros requiring a file extension.
Sign In or Register to comment.