Howdy, Stranger!

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

How do I get music to play in Harlowe?

I'm making a game in Twine 2 (Harlowe) and I would like there to be background music playing (which then changes depending on choices you make or passages to get to). Is there a macro or something to play original music from a music file? If not, what's the best way to use html to accomplish the same thing (ensuring that I can change between songs depending on where you are in the story)? Thanks.

Comments

  • Here's a link to the official Twine 2 guide: http://twinery.org/wiki/twine2:guide

    Check out the Add an Image, Movie, Sound Effect, or Music link.

    Hope that helps!
  • I know it prob a little late, but if you have OneDrive, upload the MP3 there (if its for educational purposes e.g. coursework, then do it), click the file so you see a blue circle with a tick, then click the ... in top right and click Details, copy the link.

    Here's my example:

    <audio src="https://newcollegenottingham-my.sharepoint.com/personal/41233144_academic_ncn_ac_uk/Documents/Year 2/Project 3/Týr Tú Alfagra Land Mítt.mp3" autoplay>
  • Hey guys,
    Does anyone have experiences with bugs or do I sth. wrong? I also use Twine 2 (Harlowe) but when I copy/paste the link from the guide just nothing happens. Does anyone know what could be the problem? I just pasted it below the text in one passage.

    Thank you :D
  • If you mean the following example from the Twine 2 Guide
    <audio src="the URL of your sound effect" autoplay>
    
    a. You need to replace the "the URL of your sound effect" part with a valid URL that references your sound file.
    b. If you are using a local sound file (one that is not hosted on-line) then you may need to use the Publish to File option because the Test/Play options don't play sound in some situations.
  • Hey Greyelf.
    Thank you but I tried that. I chose an URL from my Dropbox. Maybe I did a spelling mistake in the code. For example: I need to embed

    https://www.dropbox.com/s/gl75zl7u1jsiwzb/Jog on rocks.mp3?dl=0

    Can you tell me if the link should look like this:

    <audio src=https://www.dropbox.com/s/gl75zl7u1jsiwzb/Jog on rocks.mp3?dl=0 autoplay>



    ?
    THANK YOU :D
  • The issue is that the dropbox link you supplied is returning a HTML file and not the MP3 file itself, to fix this you need to change the dl=0 part of the URL to dl=1 and the URL should be wrapped in quotes.
    <audio src="https://www.dropbox.com/s/gl75zl7u1jsiwzb/Jog on rocks.mp3?dl=1" autoplay>
    
  • My audio is hosted on dropbox too and I'm having a lot of trouble. I want a track to start when it reaches a certain passage and then play for the rest of the game.

    I tried cacheing it in the Start passage:
    <<cacheaudio "walkloop" "https://www.dropbox.com/s/8oqpbpikj1nel5z/Walk_Loop.mp3?dl=1">>;
    and then in the passage it's supposed to start:
    <<audio "walkloop" loop play>>
    It's says no track ID

    Also tried <audio src="https://www.dropbox.com/s/8oqpbpikj1nel5z/Walk_Loop.mp3?dl=1"; autoplay> and it says the audio macro isn't closed.

    Any suggestions?
  • @kathy:
    Which release (web-browser-based or install-able) of Twine 2 are you using?

    Which Story Format (name and version) are you using?

    Which web-browser (brand, version, 32/64bit) and Operating System (brand, version, edition, 32/64bit) are you using?

    Did you use the Publish to File option to create the Story HTML file you are testing, or are you using the Test/Play options?
  • Using Sugarcube 1.0.26, Twine 2. I've been publishing and testing as an HTML and everything's working except the audio using Chrome 64bit on Any hints?
  • edited September 2016
    kathy wrote: »
    I tried cacheing it in the Start passage:
    <<cacheaudio "walkloop" "https://www.dropbox.com/s/8oqpbpikj1nel5z/Walk_Loop.mp3?dl=1">>;
    Don't do that. The docs tell you not to do that. Use the StoryInit special passage.

    kathy wrote: »
    and then in the passage it's supposed to start:
    <<audio "walkloop" loop play>>
    It's says no track ID
    That's a bug, which is fixed in SugarCube 1 (≥v1.0.35; current: 1.0.35) and SugarCube 2 (≥v2.6.0; current: 2.10.0).

    kathy wrote: »
    Using Sugarcube 1.0.26, Twine 2.
    How are you using such an ancient version of SugarCube 1? The current, old, version of Twine 2, v2.0.11, comes with SugarCube 1 v1.0.34 installed—and v1.0.35 is available.

    kathy wrote: »
    Any hints?
    Upgrade to a version that isn't almost ten releases behind. Better yet, look into getting SugarCube 2.
  • Ok, you don't have to shame me. Thanks for your response I'll upgrade and try that.
  • kathy wrote: »
    Ok, you don't have to shame me.
    My post wasn't meant as a shaming—though, I can see the argument. My apologies.

    The thing is this. Software packages receive updates for various reasons, one of the most important of which is to fix bugs. If you aren't keeping up with your software updates, then you are likely using buggy software. You're also, likely, missing out on new features.

    In this case, you were using a version which was behind by over a year's worth of updates. For the world we live in today, that is, quite frankly, beyond the pale.
  • I'm not so proficient in these matters, which is why I'm asking for help. You don't have to be weirdly mean about it. Anyways, I really do appreciate your response, and it worked. Thanks!
  • In my last post, I apologized for my post which preceded it, which I admitted could have been taken in a manner which I did not intend. I also attempted to explain what I had been trying to get at—that running wildly out of date software is a bad idea. Mea culpa.

    I have not been mean, weirdly or otherwise. I'm unsure why you feel the need to keep tilting at that windmill, even after my initial apology—especially after my apology.
  • Yes, I appreciated your apology, but then you kind of just restated your comment by saying that not having updated software in this world is "beyond the pale", as in unacceptable. Not sure if that's fair to say, but I thanked you and didn't see my response as confrontational. Sorry if you took it that way! I was explaining the way I felt.

    Now you've said that I'm "tilting at that windmill", as in being crazy, even though I thanked you, so it seems like you just can't help it with the insults...

    Maybe you don't intend to really be acidic with those remarks, but they are sort of demeaning from my perspective.
  • edited September 2016
    kathy wrote: »
    Yes, I appreciated your apology, but then you kind of just restated your comment by saying that not having updated software in this world is "beyond the pale", as in unacceptable. Not sure if that's fair to say, but I thanked you and didn't see my response as confrontational. Sorry if you took it that way! I was explaining the way I felt.
    In an era where unpatched software can get your life—and those you have contact with—virtually destroyed by thoroughly unpleasant villains, yes, yes it is unacceptable and you shouldn't be surprised when people point that out. Not that Twine 2/story formats are likely to be a source of danger, however, the point remains.

    I took neither instance of your stated gratitude as confrontational, I appreciated them in fact. In neither case, however, did you simply offer gratitude. In the first instance you claimed that I was "shaming" you, in the next that I was being "weirdly mean".

    I can live with the first, as I've already noted. The second, however, I refute wholeheartedly.

    kathy wrote: »
    Now you've said that I'm "tilting at that windmill", as in being crazy, even though I thanked you, so it seems like you just can't help it with the insults...

    Maybe you don't intend to really be acidic with those remarks, but they are sort of demeaning from my perspective.
    You're the one who decided to continue this tiff after my apology, what else would you call it?
    1. I wrote my first reply.
    2. You claimed that I was shaming you.
    3. I intended no harm with my original reply, but I apologized anyway to smooth things over, as I could see that my phrasing had been awkward. I also attempted to explain my position in a different way, so as to clear up what I had been getting at—which had not been to shame you.
    4. You then claimed that I was being weirdly mean.
    5. Since you decided to take a backhanded poke at me, even after my apology, I pointed out the windmill.
    6. Now, I've graduated to being insulting, acidic, and demeaning.
    Pot, meet kettle—I'm sure that will garner me yet more derision.
  • edited September 2016
    Okay. This has gotten out of hand. We need to take a step back.

    My point with the "windmill" comment was simply this: you're on a wild goose chase, you're attacking imaginary enemies, you're seeing something which is not there. I am not your enemy. I thought I had made that clear with my apology, however, ever since then you keep ascribing more and more uncomplimentary things to me, backhandedly no less.

    Case in point. You could have simply accepted my apology and moved on, but you didn't. You could have simply said, "Hey. Thanks for the apology, but I feel that the rest of the post was a little aggressive/abrasive/whatever."—I would have been fine with that, BTW—but you didn't. You started with the backhanded insults, specifically that I was being "weirdly mean". When I took exception to that and wondered why you felt the need to tilt at the windmill—i.e. attack someone who is not your enemy—that only served to earn me other backhanded insults, as if you're somehow a victim here.

    You are not a victim and I am not your enemy. If you still cannot accept that you're seeing something which is not happening, could we at least agree to disagree and move on.
Sign In or Register to comment.