In Unity 4.x i was loading .wav files into AudioClips with the code below. Yesterday i updated to Unity 5 and now this is not working anymore. It will now just stay in the while-loop since the data is not loaded and thus cannot play the AudioClip.
Am i doing something wrong or did something change?
WWW AudioToLoadPath = new WWW("file://" + pathname);
Track loadedAudio = Instantiate(TrackInstantiator) as Track;
loadedAudio.GetAudioSource().clip = AudioToLoadPath.GetAudioClip(false);
//A bit hackisch... But it's needed to load the audio
while(!loadedAudio.GetAudioSource().isPlaying){
loadedAudio.GetAudioSource().Play();
}
loadedAudio.GetAudioSource().Pause();
(Track is one of my own objects with an AudioSource)