0 votes
by (120 points)
edited by

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?

EDIT:

I put this project on pause to work on bigger things. I know of Sugarcube's audio macros, they're quite nice, I've used them in past projects.

My goal was pure aesthetics-- the theme of the project was to really replicate the feeling of being on a personal page like myspace or tumblr in a visceral way. My temporary solution was simply to create a graphic of an audio player but continue to use macros. But having an embeded audio player would have been a nice layer of authenticity. I like the idea of the reader being able to interact with a playlist right on the screen.

I'm progressively getting better in Twine, and at understanding and writing html & CSS, but this little thing might be slightly too ambitious for my skill level right now. 

2 Answers

0 votes
by (159k 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 (44.7k 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.

...