Forum Discussion
phileday
10 years agoMHCP Member
Loading external audio and Oculus Tracking
In my project I have external audio being loaded from a hard drive location using the www feature of Unity. I didn't think this was too intensive but whenever it loads in the audio the Oculus screen freezes for a second. This also happens when loading in png's using the same method. Maybe this is just something that I have to live with but I wondered if anyone else had this issue or knows of any solutions to it. My project is a dynamically updated one so loading all the audio at the beginning isn't an option.
Any help would be gratefully received
Phil
Any help would be gratefully received
Phil
4 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionIs it possible to load asynchronously?
- AnonymousAre you using yield return www? If you are, that's what's blocking the main thread while your audio/image loads.
- petereptProtegeFor the audio, are you using a streaming audio source?
For the textures - the www download is handled nicely with co-oroutines (so during download you're not going to freeze), but the actual load is intensive. You can use calls like Texture2D.LoadRawTextureData() which is much faster then ww.Texture - but it requires the image in a more specific format:
http://docs.unity3d.com/ScriptReference ... eData.html - philedayMHCP MemberThank you for your help. Looking at what you're saying I think I'm going to be looking at some pauses regardless of what I do. It's good to know that I'm not doing anything wrong though and that there isn't a straight forward solution that i'm missing.
The Texture2D.LoadRawTextureData looks interesting but might mean that you can easily have bad file formatting that will break the input. I have got a yield in there which I'll play round with to see if that reduces it as much as possible. I don't think it's possible to load asynchronously unless anyone has advice on doing that.
If I find any ways to significantly improve the issue I let you know.
Thanks for your advice.
Phil
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 6 years ago
- 1 year ago
- 2 years ago
- 4 years ago