Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Xatoku · Apr 24, 2011 at 03:26 PM · audiomultipleclipssources

Multiple Sound Effects?

Is it at all possible for Unity to play multiple sound effects at the same time? I've set up 5 different audio sources and told which sound effect to play from yet whenever I'm playing one of them, the others will not play. Am I doing something wrong or is it actually impossible? If you can help, please leave an example script. Ex:

var AudioSource1 : AudioSource;
AudioSource1.PlayOneShot(FootSteps);

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 Jesse Anders · Apr 24, 2011 at 07:32 PM

Of course it's possible to play more than one sound at once. It's possible you've run into a bug or driver problem or something of that sort, but more than likely it's just a simple error in your code. (Without seeing the code though, it's hard to say what might be causing the problem.)

Comment
Add comment · Show 4 · 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
avatar image Xatoku · Apr 24, 2011 at 10:07 PM 0
Share

Could you tell me how to go about it? Because the above example is pretty much the audio portion of the code.

avatar image Jesse Anders · Apr 25, 2011 at 08:15 AM 0
Share

Hm, there's really not that much to say about it. If you have two AudioSource components, and you start playback on both audio sources (e.g. using Play(), PlayOneShot(), etc.), then both sounds should play at the same time. If that's not happening for you, then something is probably wrong somewhere (e.g. in your code or in your project setup).

avatar image Xatoku · Apr 25, 2011 at 02:34 PM 0
Share

So I did it the right way initially?

avatar image Jesse Anders · Apr 25, 2011 at 03:39 PM 0
Share

What you posted looks fine, but it's not a complete example. To say for sure whether it would work, I think we'd need to see a complete script (or at least a complete code sample).

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

No one has followed this question yet.

Related Questions

Multiple Audio Source Problem 1 Answer

Can I play multiple AudioSources from one gameobject? 8 Answers

Play back multi channel audio 0 Answers

Possible MultiChannel Audio composer software? 2 Answers

Problems playing multiple Audio Sources in prefabs 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