I am attempting to make a looping background music track that won't restart every passage. I am using these macros in my StoryInit passage:
<<cacheaudio "bgm" "Audio/temple_of_the_mystics.wav">>
<<audio "bgm" loop play>>
My audio is saved in the twine stories folder, in a subfolder called "Audio" as above
Is it just because a .wav is too big to load? I'm trying to get the structure in more than anything.
Any advice would be much appreciated! I'm sure I'm missing something obvious.
Comments
What browser are you using for testing? Also, can you attempt a different file type to see is there's any luck there (mp3, ogg, etc)? Double check for typos/capitalization mistakes as well (I know you probably already did, but it can't hurt).
Your formatting/syntax looks fine to me.
The 'Stories' folder is also not a good location to save the Story HTML files you create using the Publish to File option, because you could end up overwriting your Story Project file. You don't need to change the URLs your using.
I suggest you create a new folder somewhere else on your local hard-drive to save the Story HTML files (you create via the Publish to File option) into, add a Audio sub-folder to it and save your audio files within the sub-folder.
The audio files should now play when you view a Story HTML file within your web-browser.
I'm using Firefox, but have also tested in Edge to the same effect. I did an extra double-check of the filenames after your suggestion, and found that I did in fact have typo -- temple_of_the_mystics was temple_of_the-mystics, and I COULD NOT see the hyphen. Combined with greyelf's advice, I have got this working. Thank you so much!
Thank you very much for the advice! I am making sure to Publish to a separate file and to store resources there as well. Combined with Chapel's advice I have now got this working. As a final check -- is it normal that audio works in the published file, but not in the working Twine file/debug mode?
I am genuinely so excited about this story.
Thanks! Good to know.