• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by edwood_grant · May 06, 2012 at 09:45 PM · audiowwwaudioclipfreezeaudioclip www load

WWW.GetAudioClip Freeze

Hello,

I've been loading some audio music clips from the web using WWW (and in some cases saving in the disk and then reloading again, due to some WWW limitations).

Everything actually works fine, but the problem I have is that when I use the WWW.GetAudioClip function, or even WWW.audioClip, the game freezes for a while. This freeze is mild in the webplayer, but in mobile devices it can really be seen for about 2-3 seconds.

I assume this happens because, well, it is a song of about 2-3 MB and it guess that it must load all of that into memory. But I would like to know if there is a way that I can async load this somehow so the freeze stops.

I could set the streaming parameter to true, but the thing is that I need the sample data to interact with, so that is not possible. I can't use threads either, because almost all of the Unity API is not thread safe, and it won't let me use it on threads (throws an error when doing it).

And I cannot use AssestBundles because A) I don't have Pro version, and B) I get the songs in mp3 or ogg format from an external service...

I know there is no much room to work on, and I am starting to assume there is nothing I can do about it and ill have to let it be that way. But I still write this question to ask if anybody has fund a workaround or if anyone has another solution to this problem?

Thanks a lot.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by edwood_grant · May 21, 2012 at 07:07 AM

There was some sort of answer by posting in the forum here:

http://forum.unity3d.com/threads/136028-Help-with-WWW.GetAudioClip-Freeze-please

Looks like there is basically no way to stop this as for now, and there does not seem to be any workaorund for it, just have to live with the freeze I guess...

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

loading/streaming audioclip using www class [android] 0 Answers

Playing wav audio with integer samples 1 Answer

WWW GetAudioClip not working correctly for Unity 4? 1 Answer

How to have www streaming to work with a radio station? 1 Answer

How do i stream music from a server? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges