0 votes
by (220 points)
Using Sugarcube2 (or any format for that matter) is it possible to load an mp3 in story.init and then in a given passage have only a section from point a to point b played, for example, PLAY ONLY from 18 seconds in to 28 sections in? And to give the reader the option to have the sound played again?

2 Answers

+1 vote
by (68.6k points)

Possible?  Yes.  Currently easy?  No.

The technique you're referring to is called audio sprites.  None of the story formats bundled with Twine 2 currently includes support for audio sprites—most don't offer any built-in audio support at all, beyond what players' browsers provide.

If you desperately need audio sprites, then, currently, your only options are either to:

  1. Use a third-party library that includes audio sprite support—e.g., Howler.js.
  2. Roll your own audio sprite solution.

 

by (220 points)
Thanks. I will look at howler.js, though it is probably beyond my coding skills.
+1 vote
by (190 points)
Could you just edit the mp3 so it's only just :18 - :28 long?
by (220 points)
Yes. But I would need to do that a lot since the goal is a French short story narrated by an actual French speaker. Each paragraph probably would need its own audio file. Tedious, but maybe quicker than learning about Epub3 or Daisy or the needed XHML or XML and the overlays they require. Digitial publishing of books with human audio is a mess. Even captioning video seems to have at least two standards--one for broadcast pros and one for ordinary humans. But even the one for ordinary humans is not easy to grasp. So your brute force method might actually be easier in the long run.
...