Howdy, Stranger!

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

sound in sugar cube

hello all!
i've been trying to get music to play in my twine game to no avail. I'm using the desktop version.
I've been trying to add the code from here into the javascript:
thanks !


  • i don't know if this is the best process ~ or what to do . any help would be greatly appreciated <3
  • That code was written for the Sugarcane story format and should not be used.

    I am going to assume you are using the version of the SugarCube 1 story format that comes with the Twine 2 application, if this is correct then I strongly suggest you read it's documentation.

    If you look at the macro list you will see that it comes with its own built-in audio macros.
  • hello again!
    so i added this to my story:
    <<cacheaudio "boom" "media/audio/bohren.mp3">>
    <<audio "boom" play>>

    i have the audio file in the twine folder. then in media > audio > [bohren.mp3]
    however, I cannot seem to get any sound working. I understand the desktop version might not be able to utilize sound , but when i tried publishing file i got an executive error as well.
    thanks for the help.
  • smooothiez wrote: »
    ... but when i tried publishing file i got an executive error as well.
    What exactly did the executive error message say?

    Which web-browser (brand and version) and which operating system (brand, version, 32/64bit) are you using.
  • the message says:: apologies! a fatal problem has occurred. Aborting! Error FAiled to execute 'replaceState' on 'History:' A history state object with URL file:///C:/Users/Chris/Downloads/bm.html/' cannot be created in a document with origin

    Im using a chrome browser Version 46.0.2490.80 . Im using windows 7 64 bit !!

    Thank you!
  • That's due to a change in Chromium (from which Chrome and Opera, to name two browsers) are built. The issue has been addressed with a workaround in SugarCube 1.x, which you're probably using, and completely fixed in SugarCube 2.x.
  • what is the work around ?
  • smooothiez wrote: »
    what is the work around ?
    I will assume you are asking how do you get around the issue and the answer is you need to update the version of SugabCube you are using, this would of happened automatically if you are using the on-line version of Twine 2 and SugarCube 1.
    If you are using either one of the downloadable versions of Twine 2, or a local copy of SugarCube 1 or 2, then you will need to manually download and install the relevant SugarCube update yourself.
  • damn, i keep trying and it's not working. I've used the online version multiple times too.
    I'm really sorry, could you go through the step by step process to incorporate music?
    I would really appreciate it.
    Thanks so much :'(
  • smooothiez wrote: »
    ... could you go through the step by step process to incorporate music?
    I have attached a Twine 2 archive file containing a demo story.

    The demo was created using the on-line version of Twine 2.0.10 using Firefox on Windows 10, use Twine 2's Import From File option to add it to your story list.

    The sample.mp3 file I used comes from here.

    If you create the folder structure listed in the Start passage, place the sample.mp3 file in the correct sub-folder and save the story HTML you generate in the correct folder then you should be able to hear the sample play.
Sign In or Register to comment.