twine 2 sugercube 2 No audio what-so ever

0 votes
asked Aug 26, 2017 by Phayden (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
answered Aug 26, 2017 by Chapel (48,690 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. 

commented Aug 26, 2017 by TheMadExile (46,480 points)

In other words, you need something like:

<<audio "mememe" play>>

 

commented Aug 26, 2017 by Phayden (120 points)
tried that, still nothing? everything works normal, just no sound
commented Aug 26, 2017 by Liamw104 (2,880 points)
Turn up the volume?

(If that doesn't work then I don't know.)
commented Aug 26, 2017 by Phayden (120 points)
i wish it was that easy
commented Aug 26, 2017 by Chapel (48,690 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.
commented Aug 26, 2017 by greyelf (90,670 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"

 

commented Aug 27, 2017 by Phayden (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">>?
commented Aug 27, 2017 by Chapel (48,690 points)

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

commented Aug 27, 2017 by greyelf (90,670 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.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...