0 votes
by (120 points)

I am using Twine 1.4.2 and Sugarcube 2.

I will preface with the fact that I have a very rudimentary understanding of HTML and CSS and Twine's limitations/abilities.

I've been hunting for a way to put a music player into my twine story, in the same style of some Tumblr blogs and old myspace pages (a la https://www.wikplayer.com/). It doesn't seem possibly with the generic embeddable players. I feel like I got pretty close with this method using an iframe but it wasn't quite right for my needs. It can't be embedded in just one passage, it has to persist over the entire Twine story.

Is this feasible? Or should I simply scrap this goal and put my audio into Twine the old fashioned way?

2 Answers

0 votes
by (154k points)

Are you just looking for a way to play audio files (sounds, music) from within SugarCube 2.x based project, or do you actually need to embed a (JavaScript based) Music Player application?

If the 1st option then you should read the Audio Macros section of the SugarCube 2.x documentation.

If the 2nd option then what functionallity do you need the embedded Music Player application to have?

0 votes
by (38.6k points)

I think it might be better to back up a step and ask what you want the audio to do for your story?  I ask because I'm kind of struggling to think of a reason why you'd use a player like that, instead of using the audio tools built-in to SugarCube.

Also, if you are using SugarCube to play your audio, I'd make sure you have the latest version (currently SugarCube v2.28.2), since there were some recent improvements to how SugarCube handles audio.  If you need it, you can download the latest version here and the installation instructions are here.  Beyond that, I have some audio sample code here, which not only shows how to play audio in Twine, but also explains how to overcome some potential issues you may encounter due to new-ish browser security changes.

Anyways, I'd say that it almost certainly can be done, but you'd be struggling against Twine to do it, rather than using the built-in tools which make it easy, so I'm wondering if there's any good reason why you'd want to do it that way.

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.