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 lawero · Feb 17, 2014 at 04:43 PM · sounddelaystartcoroutine

Delay between clicks and sound

I have this code inside OnGUI()

 //BLA BLA
 //when click button
     StartCoroutine(PlayAudio(click,"email"));
 //BLA BLA

and this method

     private IEnumerator PlayAudio (AudioClip clip,string control)
     {
             
             audio.volume = 1.0f;
             audio.loop = false;
             audio.clip = clip;
             audio.Play ();
             yield return new WaitForSeconds(audio.clip.length);
                     //BLA BLA I do this after sound finish
     }

The problem is that the sound doesnt start when i click but after a few millisecond,and I do not why.

Comment
Add comment · Show 2
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 OrbitSoft · Feb 17, 2014 at 05:00 PM 0
Share

$$anonymous$$aybe its because you are using mp3 files which always have a delay in the start, try using .wav or .ogg format.

avatar image lawero · Feb 17, 2014 at 05:49 PM 0
Share

THis is very useful! Thx The situation is a bit better but there is still a delay. On unity there is no delay, but it happen when I load the app inside the Ipad. I noticed this right now

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by MakeCodeNow · Feb 17, 2014 at 05:41 PM

Try setting a lower DSP buffer size. I've posted more info on that in other answers here.

Comment
Add comment · Show 2 · 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 lawero · Feb 18, 2014 at 08:41 AM 0
Share

problem 100% solved for ios, not tested on android

Thx!

avatar image Shahar_Infiapps · Jun 18, 2015 at 12:03 PM 0
Share

It's say: "page not found" can anyone post the solution?

avatar image
0

Answer by EdKirby · Dec 27, 2016 at 08:08 AM

As someone pointed out in a comment the original answer's link 404's. Here is an updated link: https://docs.unity3d.com/Manual/class-AudioManager.html

If anyone is curious if this works, this fixed the issue for me as well.

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I'd like to move a cube without delay.(C#) 0 Answers

How to appear object on trigger delay? 2 Answers

GUI movie texture - sound delay 1 Answer

Portal Sound start AFTER the Teleportation 0 Answers

How to make a sound play and have a delay after so it can't be activated again very fast? 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