0 votes
asked by (2k points)

I'm a noob, and I'm trying to figure where I'm supposed to put this:


Also, how do I get it to loop and how do I get it to not reset from passage to passage?

I got it here https://twinelab.net/harlowe-audio/#/

I have put both javascrypt code and css code of harlowe audio library where they belong.

1 Answer

0 votes
answered by (59.9k points)

This is explained in the documentation. For A.newTrack():

  • Setting up your tracks should be done early, and you have a few options: use startup-tagged passage and <script> elements, or write the track definitions in JavaScript (but after the library).

There are code examples of what each option would look like listed in the docs.

As for looping and playing, check the track method list. There's also an example. To start a track looping, you would generally use A.track('track-name').loop(true).play() or A.track('track-name').loop(true).playWhenPossible() based on your needs.

Again, all of this is in the manual. I know it's long, but you can always ctrl-f to find specific things.

commented by (2k points)
Yeah, I finally got it to play, thank you very much. I have some problems understanding english.
commented by (59.9k points)
Ah, fair enough then.
commented by (2k points)
Are you the writer of this code? I wanna say thank you so much, I'm loving it so far.
commented by (2k points)
And if you are not, also, thank you very much for answering my question.
commented by (59.9k points)
I did make the library. And you're very welcome.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.