I try to add background sound in a rails app. The code is like this:

embed src="followme.mp3" autostart="true" loop="true" hidden="true"

but where should I put the sound? In the assets folder?

有帮助吗?

解决方案

Easy Answer

Put the file in the public/ directory. Example: public/my_audio_file.mp3

Better, Cleaner Answer

Put all of your audio files in a single folder like: public/audio/my_audio_file.mp3. Then do something like:

embed src="audio/my_audio_file.mp3" autostart="true" loop="true" hidden="true"

其他提示

Go to the properties tab at the top ... select your project properties and then go to References. Make a new reference folder if one does not exist, and Add Reference. Now select the path wherever you have created the object audio file from its properties. Simple eh :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top