• 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
1
Question by amirabiri · Jun 15, 2012 at 02:30 PM · audioaudiosourceaudioclip

Audio playing for a very long time

I am spawning an audio source object for each collision between two objects of a certain type. These collisions happen often.

The problem is that the audio is about 3s long, but for some reason it sometimes takes a long time to play and die (I have a script that destroys the object when it finishes playing). The scene ends up having a ton of them not dying and they are screwing up sound playback. I have done some debugging and in some cases it takes 20s+ to run the 3s of the clip.

Probably worth noting that:

  1. A lot of these are spawned.

  2. I am tweaking the pitch per collision in relation to the impact of the collision.

  3. I've put the priority to 255 so these don't block the "main" sounds of the game.

Does that ring any bells to anyone?

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
1
Best Answer

Answer by amirabiri · Jun 15, 2012 at 02:58 PM

OK It was the pitch. I guess to achieve the lower pitch the audio is slowed down (which makes sense).

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Unity 5 low audio volume 1 Answer

Playing many audioclips with PlayOneShot causes all sound to cut out. 0 Answers

2.1ch, 4.1ch, 6.1ch 音源の再生方法について ( About how to play 2.1ch, 4.1ch, 6.1ch sound source) 0 Answers

Why does AudioSource cut off beginning of manually looped clip in certain conditions? 1 Answer

How to cancel SetScheduledEndTime? 1 Answer

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