- Home /
Playing AudioClip in Runtime
audio.clip = Resources.Load("wind", typeof(AudioClip)) as AudioClip; audio.Play();
Attempting to load audio (wind.wav) during runtime, but Audio Source properties says that no sound is loaded.
do you need to load it in runtime? or can you have it set to load with the rest of the game?
Yes, I need them in runtime. I'm using randomly spawning cubes and I don't see any other way to do it.
Just tried it here and didn't work, I'm now intrigued why.
Can it play .wav files? Have you tried converting it to .ogg first?
Could you create a prefab of the cube that you're instantiating at runtime with the audio clip already loaded into it?
Your answer
Follow this Question
Related Questions
How to reproduce a sound when my character collide 1 Answer
Decreasing footstep length when key pressed 1 Answer
Allowing users to import their own UnityScript/JavaScript into the game at run time 1 Answer
Is it possible to make a random sound script? 2 Answers
Assigning the script over the target (from surviving island) 2 Answers