twinesugarcube

Can't play a sound effect in Twine 2, SugarCube?


I've tried four different methods of playing audio in Twine now and none have worked. Currently I'm trying to use SugarCube 2.36.1 as it has audio macros.

In a special passage named StoryInit I have the following:

<<cacheaudio "laugh" "mp3|https://drive.google.com/uc?id=1PM-ErMPjo0c-UTujjmlPEWgaMnAj-9Vq">>

In the second passage of my story I am using:

<<audio "laugh" play>>

As far as I can tell, this is all I should need, however no audio plays when I get to the second passage. I've tried this in and out of testing mode, on multiple browsers, and with the Twine application.

I also tried switching to SugarCube 1.0.35, which didn't solve the problem but gave me an error in testing mode which said "Error: <>: no track by ID: laugh". I'm not sure if this error is the case only in 1.0.35 or if it's still the issue in 2.36.1 but just doesn't show up as an error there for some reason. As 1.0.35 didn't fix the issue, I'm sticking with version 2.36.1.

Thanks for the help, this has been driving me mad.


Solution

  • For anyone else with the same question, I finally solved the issue! I have a site using Github so I uploaded the audio file into my site's folder and then used the url to the file.