How to enable music to play when a passage opens

Hi all,

Could anyone advise how some music (a .m4a file) plays when a user opens a passage in my story? If possible I would not like any sound controls to display including volume and stop/start buttons.
I am using the latest Twine Sugarcube version.

Thanks

Have you read the documentation on Audio Macros and the Audio API? There’s some sample code there with exactly what you need. :slight_smile:

I have a whole chapter on how to use the API in my Guide if you’re interested.

2 Likes

Manon’s Guide is 100% Good! 100% Free! 100% Wor… poof cough cough

1 Like

@TobiasRoadRunner
warning: The security system of many modern web-browsers, especially those used on mobile devices, will not allow audio (1) to automatically play if the end-user has not interacted with the page yet.
eg. Audio will not automatically play in the first Passage your project displays.

So you will need to either: transition to at least the second Passage displayed by your project; or use a <<link>> macro on the first Passage displayed; to test if you’ve successfully setup / configured your audio functionality.

(1) this includes videos that include a sound track.

1 Like

cheers all, these worked.