Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Am using audio macros but no audio will play? (Sugarcube 2)

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

  • vicorva wrote: »
    Is it just because a .wav is too big to load? I'm trying to get the structure in more than anything.
    I doubt it's specifically related to file size. WAV, in spite of being a Microsoft file type, also has pretty wide support. I'd be downright shocked if it had much to do with any of that.

    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.
  • edited February 2017
    The folder accessed via the Twine > Show Library menu items (in your case the Stories folder) is for the applications internal use, files you manually add to that folder (or any sub-folder you create within it) are not automatically available to your story projects, nor can you use a local reference URL to include these added files in the temporary Story generated using the Test and Play options.

    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.
  • Chapel wrote: »
    vicorva wrote: »
    Is it just because a .wav is too big to load? I'm trying to get the structure in more than anything.
    I doubt it's specifically related to file size. WAV, in spite of being a Microsoft file type, also has pretty wide support. I'd be downright shocked if it had much to do with any of that.

    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.

    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!

    greyelf wrote: »
    The folder accessed via the Twine > Show Library menu items (in your case the Stories folder) is for the applications internal use, files you manually add to that folder (or any sub-folder you create within it) are not automatically available to your story projects, nor can you use a local reference URL to include these added files in the temporary Story generated using the Test and Play options.

    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.

    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.
  • vicorva wrote: »
    As a final check -- is it normal that audio works in the published file, but not in the working Twine file/debug mode?
    Unfortunately, yes. Due to the A/V library it's shipped with, Twine 2's Play and Test modes do not support many media formats aside from images.
  • Unfortunately, yes. Due to the A/V library it's shipped with, Twine 2's Play and Test modes do not support many media formats aside from images.

    Thanks! Good to know.
Sign In or Register to comment.