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 lil_billy · May 13, 2011 at 04:17 PM · audiobugdelay

odd audio delay

function warning_action() { if(warning==false) { moving= false; model_swap("o"); StopCoroutine("re_enable_moving");

    BO.animation.Play("up");    
    audio.Play();
    if(!audio.isPlaying)
    {
        warning=true;
    }
}

}

so heres the problem, this function is a tiny behavior of my AI whats happening here is my AI goes through a subtle warning stage to alert the player to GTFO when it gets to the animation the AI Stands up and its also supposed to play an audio track now it plays the animation however it wont play the audio or more precisely it wont play the audio till this function completes instead of directly when i call it like i want it to

another oddity is, you will notice the if(audio isnt playing) condition yeah, so if the audio does stop playing it would have finished this function naturally however IT NEVER finishes naturally, it always finishes with my external condition, then plays the audio

so that means, whats happening is the audio is both playing but at the same time not playing help?

-yes i have an audio source, it is playing the sound....eventually -oh and those top 3 commands have no relation to whats going on

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 lil_billy · May 16, 2011 at 05:07 AM 0
Share

so yeah i never could figure this out , and its true for every other time i tried to play audio, is it a unity thing that prevents audio from playing on call, forcing it to only play when a function completes

1 Reply

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

Answer by Sren Christiansen · May 17, 2011 at 02:01 PM

This is intended. We sync audio across all scripts and play it at the exact same time (at the end of the frame). In any case, audio will never play right away. You have to wait for the mixer to pick it up. mixes it, pushes it to hardware etc. We have no way to actually know when this happens. That's why isPlaying() is true from Play() is called till it stops.

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

No one has followed this question yet.

Related Questions

Kindle Fire sound files always delayed 0 Answers

UnityWebRequestMultimedia.GetAudioClip dont't work in WebGL build (2019.3.15f1). 1 Answer

Unity Iphone AudioQueueAddPropertyListener problem 1 Answer

Unity Analytics Bug/Delay 4 Answers

How to delay a audio loop? 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