|
I am loading and playing an .ogg file from the harddisk. To do this I use the method described in the WWW documentation:
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...
(comments are locked)
|
|
If the sound is stereo you uncheck the 3D sound checkbox for the sound, if sound is mono, it's always played 3D positioned. --- Reaction on comment: In that case I don't think you have many other options than add a sound source component to the camera and use this for playing back non-positioned sounds. Well the sound is a stereo file (music) and the problem is, that I'm loading it during runtime, it's not an asset, so I can't uncheck the checkbox... I'd have to do it via scripting and I don't know how.
Feb 20 '10 at 12:08 PM
StephanK
(comments are locked)
|
|
Not tested but setting the rolloff to zero may be help.
(comments are locked)
|
|
Set doppler effect to 0 and see what happens.
(comments are locked)
|
|
I found the problem to be "dopplerLevel" myself, adding some setup code to my audio source alleviated the problem:
(comments are locked)
|

Did you report a bug on this? in that case, can you post the 6-ciphered case number, so we can follow up on it and link this question to the case. Thanks.
If you want I can file a bug, but it's more a missing "feature" (not being able to create non 3d sounds on the fly) than a bug.