Audio doesn't play. No sound and No error.

0 votes
asked Jun 13 by Simply Sudhanshu (310 points)

I am very new to Twine. I am using SugarCube 2.25 and Twine 2. I used the proper macro for caching audio and a simple play command in the start passage. But there is no sound, when I test the story, or publish to a file and execute it. I tried relative referencing for source URL, entire path for source URL, tried various other tricks from documentations and tutorials, I tried MP3 and OGG files, gave multiple sources for same sound. but just cant get sound to play. I am sure its just a noob mistake and some silly part I am missing, but Please Help !

Thank you in advance.

<<cacheaudio "audio1" "E:\Coding\Twine\Nine\Init_audio.mp3">>

<<audio "audio1" volume 1 loop play>>

 

2 Answers

0 votes
answered Jun 13 by Jherek (2,960 points)
selected Jun 14 by Simply Sudhanshu
 
Best answer
sound might be disabled by the used browser.

does the browser play other sound sources well?

There was a similar question a few days ago, do not have the time to look for it now.

But trying another branded browser and/or checking the sound settings of Operating system or device  might be a first hint.
commented Jun 13 by Simply Sudhanshu (310 points)
I am using Chrome and it plays other sounds. checked sound settings, but still it doesnt play. I will try on another browser and look for the similar post in the forum too,

 

Thanks..
commented Jun 13 by Jherek (2,960 points)

Now I found it:

http://twinery.org/questions/16553/music-wont-play-online-chrome-but-plays-in-desktop

In the comments of that question greyelf had a few questiins to narrow the reason.

commented Jun 13 by Jherek (2,960 points)
You see the list of 'related questions' on the rignt side, don't you?

It took me a few days in the beginning to discover them, therefore this hint :-)
commented Jun 13 by Simply Sudhanshu (310 points)
I think, chrome is the culprit here, but I also couldn't get sounds to play in Twine 2. I will try another browser
commented Jun 13 by greyelf (97,410 points)

The Desktop release of the Twine 2 application (which is built upon the same web-browser engine as Chrome) has issues with playing media (audio & video) whenever the Test or Play options are used, this is why you will need to use the Publish to File option whenever you want to test/play with those types of media.

note: (some?) Mobile based web-browsers generally won't auto-play media files, they will require some sort user interaction with the page to start them.

<<link "Click me to Start the sound!">>
	<<audio "audio1" volume 1 loop play>>
<</link>>

 

commented Jun 14 by Simply Sudhanshu (310 points)
Oh, I see.. Inserting the code for audio, in a different passage played the music as soon as the user landed on that passage. But the Start passage won't play my sound..

 

Thanks for the tip for mobile devices. It helps a lot !
0 votes
answered Jun 13 by Jherek (2,960 points)

Another approach to this question is the location of the soundfile on your local disk.

There is a hint on the Twine2 guide page, see here:

http://twinery.org/wiki/twine2:add_an_image_movie_sound_effect_or_music

Additionally I can report that I could not play sounds without exporting the story to local file.

it did not work by starting play inside Twine2 itself

 

commented Jun 13 by Simply Sudhanshu (310 points)
I placed my audio file, right beside my exported file, For the source link, I used only the file name and also tried the entire path, but still couldn't get it to play.
commented Jun 13 by Simply Sudhanshu (310 points)
I GOT THE MUSIC !

But the catch is that I cut the lines of code and placed them in a different passage. The same code worked in different passage but not in start passage. I have two links in my start passage which both lead to a single passage but with different values in some variables. Hence, when I clicked on a link, the user was directed to different passage, and this time Chrome played the music...

 

Is this a bug or something?
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.
...