I am loading and playing an .ogg file from the harddisk. To do this I use the method described in the WWW documentation:
WWW www = new WWW(url);
audio.clip = www.audioClip;
This seems to work, but when I start the clip after checking if clip.isReadyToPlay it starts playing but after a second or so it will start sound really weird, like it's played at too slow and inconsistent framerates.
To add some more weirdness, if I start the game in the editor and then tab to another application, so the editor runs in background the file plays back at a consistent framerate, but the rate seems to be too high, as the file is faster/higher pitched.
Any idea what might be causing this strange behaviour?
EDIT: The strange behaviour is a result of the audio clip being played back as a 3D sound per default, because my listener (which is attached to the camera) moves very fast and the AudioSource doesn't. I guess that's also why the behaviour is different when running in background as the listener does not move then.
Is there a way to mark the created clip as NOT being a 3D sound via scripting? I know I could circumvent this by attaching the audiosource to the camera/listener, but I'd rather not...