- Home /
Problem with streaming audio and play in trigger area
When I step inside the trigger area, "PositionTrigger.room_a" will return a String like "101",then it's checked if true, the audio will play, but nothing happen. But when I come out, the audio plays. Here is my code.
public class AudioRoom : MonoBehaviour {
public string audio_room = "http://..../101.ogg";
void Awake()
{
WWW www = new WWW(audio_room);
audio.clip = www.GetAudioClip(false,true);
}
void Start () {
}
// Update is called once per frame
void Update () {
if(audio_room == "http://.../" + PositionTrigger.room_a + ".ogg")
{
Debug.Log(PositionTrigger.room_a);
audio.Play();
}
else
{
Debug.Log("Blank");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
WWW class streaming high RAM usage 0 Answers
Multiple Audio Sources On One Object 0 Answers
How to avoid lag when using WWW class to download sound 3 Answers
Endless Audio streaming (Radio)?! 3 Answers
Splash videos on android and iOS? 0 Answers