0 votes
by (120 points)
I am trying to make a twine thing and i add the audio marcos <<cacheaudio "mememe" "desktop/psycho/Me!Me!Me!.mp3">>
 then i put

<audio mememe play> </audio>  and i export it to a file but when it is supposed to play nothing happens, like nothing silence just blank, am i doing something wrong?

1 Answer

0 votes
by (63.1k points)

Well, macros have two sets of angle brackets around them, so there's that. 

Html: 
<audio>
<script>

Macros: 
<<audio>>
<<script>>

Also, the <<audio>> macro doesn't need a closing tag. 

by (68.6k points)

In other words, you need something like:

<<audio "mememe" play>>

 

by (120 points)
tried that, still nothing? everything works normal, just no sound
by (2.9k points)
Turn up the volume?

(If that doesn't work then I don't know.)
by (120 points)
i wish it was that easy
by (63.1k points)
Which version of the Twine 2 application are you using? Are you using a local or online version, and if local, are you using the standalone application version? Also, how are you testing your audio? You may need to compile the html for certain features to work, especially features that rely on using the file system. Using the test or play options in the editor may not be enough.
by (159k points)

You are using a relative URL to your audio file:

"desktop/psycho/Me!Me!Me!.mp3"

... this means that the story HTML file you are creating via the Publish to File option needs to be save in which every folder the desktop folder is a child of.

NOTES:
a. None of the releases of the Twine 2 application can play/display a media file referenced via a relative URL when using either the Play or the Test option. This is because the temporary story HTML generated by those two options is in memory only so there is no HTML file for the media file to be relative to.

b. The install-able release of the Twine 2 application currently has restrictions when it comes to the playing/displaying of media files when using either the Play or the Test option, even when the media file is fully-referenced.
eg.

"http://some-host.com/desktop/psycho/Me!Me!Me!.mp3"

"file:///c:/some-folder/desktop/psycho/Me!Me!Me!.mp3"

 

by (120 points)
it works for me (thanks!!) using <<cacheaudio "mememe" "file:///c:/Users/Phayden/Desktop/Psycho/Me!Me!Me!.mp3">> but will it work on other peoples computer if they save the folder to there desktop but there user name is diffrent? for example <<cacheaudio "mememe" "file:///c:/Users/Kelly/Desktop/Psycho/Me!Me!Me!.mp3">>

would that still work on there computer if the html is written for <<cacheaudio "mememe" "file:///c:/Users/Phayden/Desktop/Psycho/Me!Me!Me!.mp3">>?
by (63.1k points)

You should probably switch to relative urls for your distributable build. 

by (159k points)

Using a local Fully Referenced URL will almost never work on other people's machines because you have no control over where they will place the published release of your story on their hard-drive.

I strongly suggest you continue to use the relative URLs and to use the Publish to File option to test either the playing of your audio files or the layout of your visual media.

But If you really want to switch to using local fully referenced URLs in your story testing then I suggest you create a story variable to store the first part of the full-reference and then to use that story variable when stating where to find the media.

<<set $testPath to "file:///c:/Users/Phayden/">>

<<cacheaudio "mememe" `$testPath + "Desktop/Psycho/Me!Me!Me!.mp3"`>>

... and then changing the value of the story variable to an empty String before you release a version to the public.

<<set $testPath to "">>

Doing it this way has two positive outcomes:
1. You only have to reset the first part of the fully reference URLs in one place.
2. You are more likely to remember to do that change before every release.

...