You need to using the Publish to File option to play locally referenced audio and video media files, they will not work in the install-able release of the Twine 2 application if using the Test and Play options.
Simple create a local folder on your hard-drive, save the media files as well as the story HTML file you created into it, and your locally referenced media files will work.
Very sorry, greyelf. I could have sworn I tried this, but it may have been while I was still using just 'firecrackling.mp3' instead of the whole file URL.
Just one last question. Does this mean that when ready to upload the game to a host, I don't have to worry about finding a host for the audio files too? Or do I still have to upload those separately to my own webspace?
If you are using relative referenced media files and you are hosting the story HTML file on a web-server then the media files need to be hosted on the same web-server.
If you are using relative referenced media files and you are uploading the story HTML file to a file sharing site (like Mega) then you need to include the media files with the HTML file, a common way to do this is to add all the related files to an archive file (like a ZIP file) and upload that file instead.
All you supply to IFDB is a hyper-link to where either the story HTML file is hosted online, or to where the archive can be downloaded, so either option is fine.
Compared to the specified example, no it will not suffice. Simply listing the filename only works if the audio is directly adjacent to the compiled HTML file. That particular example shows audio which is, relative to the compiled HTML file, within the sub-directory audio, which is further within the sub-directory media, which is adjacent to the compiled HTML file.
In other words, simply using "explosion.mp3" as the path only works if the following structure holds true:
compiled_html_file.html
explosion.mp3
The example, on the other hand, shows the following structure:
Comments
Last time I was trying to add sounds I had a right struggle. In the end I had to use my brothers webspace to host them.
I added a fire crackling mp3 to the same folder as my game's html file.
Then in my StoryInit passage I added:
Then in my 'Shack' passage (no jokes please) I added:
But it wouldn't play.
I've tried adding the file URL instead of just 'firecrackling.mp3' but it still didn't play.
I'm now using Sugarcube 2.11.0
Simple create a local folder on your hard-drive, save the media files as well as the story HTML file you created into it, and your locally referenced media files will work.
Just one last question. Does this mean that when ready to upload the game to a host, I don't have to worry about finding a host for the audio files too? Or do I still have to upload those separately to my own webspace?
If you are using relative referenced media files and you are uploading the story HTML file to a file sharing site (like Mega) then you need to include the media files with the HTML file, a common way to do this is to add all the related files to an archive file (like a ZIP file) and upload that file instead.
Thanks.
It took the zip but won't play the audio when I launch the game.
Any ideas?
Just a note. In the docs, why does it say use:
When
Will suffice?
In other words, simply using "explosion.mp3" as the path only works if the following structure holds true:
The example, on the other hand, shows the following structure: