Using Sugarcube online.
I found this for adding audio to a passage, but the poster doesn't state if this is for Sugarcube.
<audio autoplay>
<source src="[path edited to make it shorter]thunder.mp3" type="audio/mpeg" />
</audio>
What they also don't state is where the audio needs to be uploaded. Is it just to any host or do I upload it to Twine or something?
Also, if the above is not the code for adding audio, could someone supply it, please?
TiA
Comments
Don't use the <audio> element. Read the documentation for the SugarCube v1.x audio macros. They wrap the <audio> element API, smoothing over several browser compatibility issues and enabling more features.
As a small example: (still, read the docs)
I've tried to read the audio macros, but it all makes little or no sense to me.
Anyway, by brother says he'll host it for me.
Thanks for the code.
If I was to be specific, I think the tutorials (like most tutorials) assume too much. For instance, when we are presented with blocks of code, it's not explained properly one, where this code goes, and two, what parts of the stuff in code tags is actual code or brief lines just for clarification.
People like me need idiot sheets. Step by step instructions.
1. Create a new passage and called it StoryInit
2. In the main body of the passage, add this code: 3. Where it says "media/thunder.mp3" you need to add your own file name for your hosted audio file.
Etc, etc, etc.
Your own instructions, for instance, say that to play an audio file on a specific passage I use: But there's no mp3 here, so how does it call it? Or do you mean I replace "bgm_space" with my file name, which will be something like "..../media/wave.mp3"?
Just need to look at fading it out, etc now, but I think I can get that from the macros page.
Ta again.
The sound is waves on a shore (as this is where the player starts). I was hoping the fade out would simulate the player moving away from the shoreline.
Any way to change the graduation of the fade?
It appears not. For now I've added the file at slightly lower volumes in subsequent passages. Works quite nicely, but I think a much longer soundbite is the proper answer.
I'm not exactly keen on backporting that to v1, now that v2 is out, but I suppose it wouldn't hurt.