Howdy, Stranger!

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

Troubleshooting audio in Twine 2

edited April 2016 in Help! with 2.0
I'm using Sugarcube in Twine 2. I finally had success with a sound macro only after using wav files and testing the html file in Firefox. When I test published it to Philome.la the sound didn't play anymore. Is it because the file can't be accessed anymore?

I've also tried using youtube urls (<audio src=" autoplay> </audio>) which I thought should be easier to publish but this doesn't seem to work at all. Can anybody help me?

I'm using <<cacheaudio "bgm" "sound/gatekeeper.wav">>
<<audio "bgm" play loop>>

Comments

  • The information at Media formats supported by the HTML audio and video elements may help you understand which media files work in which web-browsers.

    I did a quick Google search but it appears that Philome.la only hosts your Story HTML file, any external media files your story needs will need to be hosted somewhere else.

    re: YouTube
    A. YouTube hosts videos and the Embed a video section of this Google Support page explains the basic steps used to embed a YouTube video into a web-page. To use those instruction with Twine you need to add one extra step between 3 and 4, and modify step 5:
    1. On a computer, go to the YouTube video you want to embed.
    2. Under the video, click Share .
    3. Click Embed.
    3a. Click SHOW MORE link below text field to see additional options.
    4. From the box that appears, copy the HTML code.
    5. Paste the code into the Passage you want to see the video in.
    The resulting HTML code will look something like the following:
    <iframe width="560" height="315" src=" frameborder="0" allowfullscreen></iframe>
    ... with the the-video-id part being the actual ID of the video.

    B. To make the above video automatically play you will need to add autoplay=1 to the end of the src attribute using an & like the following:
    <iframe width="560" height="315" src=" frameborder="0" allowfullscreen></iframe>
    C. You should be able to use CSS to hide the visible part of the video, something like the following may work but it would give the Reader no way to stop the video/audio.
    (note: I have not fully tested the following )
    <div style="display: none;">
    <iframe width="560" height="315" src=" frameborder="0" allowfullscreen></iframe>
    </div>
  • This works great for using music hosted on youtube - thanks!!!
Sign In or Register to comment.