Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • 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
0
Question by bkachmar · Jul 28, 2015 at 12:42 PM · audiounity5memoryproblem during runtime

Unity WebGL audio memory problem

Hi,

I am developing the application that can playback different audio files. Since Chrome disabled Web Player by default I am relying on WebGL. In my little demo I added 10 AudioClips in editor to my Custom Component and on Space press I playback them (25 MB each).

 GetComponent<AudioSource>().clip = audios[j];
 j++;

My files are 4 minutes long mp3 (also tried ogg) songs and after I reach 6-8 Web player crashes.

I use stripping level: Strip Assemblies, Explicitly thrown exceptions and non-development Fastest(very slow builds) settings. I am not using high end gaming hardware, but my desktop is relatively new and Unity runs without any lags (average pc of my target audience).

I tested with following memory settings: 256, 512, 1024. I actually don’t see any difference between 256 and 512, but 1024 is the worst – everything crashes after 2-3 audio.

Is there any way to achieve my goal?

Comment
Add comment
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
0

Answer by bkachmar · Sep 02, 2015 at 06:11 PM

I figured out a way to solve that.

I developed a system in javascript to preload and play audio files and Unity just sends ExternalCall to javascript that says [preload audio "http://myaudios.com/1.mp3" at second "23"] and after CanPlayThrough event it says [play currently preloaded audio file].

By the way, chrome doesn't allow to preload more than 6 audios on one page, so you will need to reload audios all the time.

Comment
Add comment · 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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

iOS - Server response is differ from os to os 0 Answers

unity5 2d audio not working (spatial blend bug?) 2 Answers

How do I get Button to play a random sound in Unity 5.0? 2 Answers

How to avoid 'auto audio volume decrease' on android? 0 Answers

Unity 5 Asset Bundles with uGUI 1 Answer


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