• 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 TheIBPoliceman · Jun 12, 2012 at 05:53 PM · audiosourceaudioclip

Multiple AudioSources overwriting a looping AudioSource

Hey all,

Having a problem with regards to AudioClips and Sources. Essentially, it seems like large numbers of AudioSources overwrite my looping music.

I run my level's music from a looping AudioSource which is pretty simple (at the moment it doesn't even have an attached script). The source has max priority (255) so shouldn't be overwritten by any of the other AudioSources in the scene.

These sources can get numerous though. In the scene I'm testing now, I have four spaceships, each with around 6-8 AudioSources each. Generally they won't all be playing at the same time. I'd estimate that I have a maximum of 16-20 sources playing at once, and the Listener shouldn't be in range of most of them. These sources all have priority 128. They generally play through PlayOneShot().

When playing the level, things start off OK, but eventually the music will get cut off or silenced - the other sounds still work perfectly though. It's getting rather vexing and I don't quite get what could be happening. There doesn't seem to be any real pattern to it other than it happens when a sound plays. Logging the state of the Music source indicates that it doesn't stop or anything.

Does anyone have any ideas? I'd think I might have run into a simultaneous source playing limit, but I haven't been able to find anything concrete (I also recall running a scene without music somewhat earlier with many more sources and no problems).

Comment
Add comment · Show 1
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
avatar image TheIBPoliceman · Jun 12, 2012 at 09:37 PM 0
Share

I should also mention that the AudioClips that are being played are mono sounds set to 3D sound, with the exception of some UI sounds that are mono and not 3D. The music AudioClip is 2 channel and not 3D.

In addition, I've now tried fiddling with the compression/load options for the clips to no real change. UI/Effect clips are compressed in memory, music is streamed from disk.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by steinbitglis · Jul 25, 2013 at 07:53 AM

255 is not max priority... it's the lowest.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Audio playing for a very long time 1 Answer

(SOLVED) Audio issue 1 Answer

Working Sound Clip not Audible on iOS Devices 0 Answers

How to get C# Array to Load into Audio Source 0 Answers

GetSpectrumData - what does it fill the samples argument with exactly? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges