Howdy, Stranger!

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

I can't get cached music to play.

Hello, I am new to Twine, and have been trying to get music playing using SuagarCube.

This is what I've got:

<<cacheaudio "Crypt" "E:\Music\Crypt.mp3">>

<<audio "Crypt" play>>

You are Beorht, the mighty Bandit. Your legend lays before you, currently it reclines flaccidly but with some effort you could inflate it to proportions more appropriate to someone of your grandeur.

Explore Crypt->Exploring Crypt

The music just won't start. Any help is much appreciated.

Comments

  • 1. The <<cacheaudio>> invocation should be in your StoryInit special passage (i.e. a passage named StoryInit), if you haven't already do so.

    2. The Twine 2 IDE's Test/Play browser windows do not support HTML5 media elements. That includes audio. You'll have to Publish to file and test that in a normal browser.

    3. You're using a local path name, not a valid file URL. Try the following instead:
    <<cacheaudio "Crypt" "file:///E:/Music/Crypt.mp3">>
    
    Though you might be better off using a relative URI instead.

    4. Obviously, a file URL probably isn't going to work for anyone but you. So, if you're planning on actually publishing your project at some point, you'll need to decide on a more permanent solution. Whether that's having the audio hosted somewhere (so you could use a full network URL and/or a relative URI) or bundling the audio with the compiled HTML (in which case a relative URI would be the way to go).
Sign In or Register to comment.