Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 negative_zero · Nov 14, 2019 at 03:47 PM · audiosourcesynchronizationtime.time

Time.time and audio time seem completely inconsistent with each other in the first few frames, difficulty syncing audio and movement

Hey all!

I'm making a game that involves syncing audio and movement up, nothing fancy that needs EXACT precision but it needs to be pretty close, within a 0.1 second or so margin of error.

For the most part it works except... in bigger stages with more going on the audio time (calculated by samples / frequency) can get a second or more off from the movement right at the start. Looking into it, it looks like something weird is going on the first few frames. I'm attaching an image that shows a simple stage on the left (with a slight gap between the Time.time and audio time) and a more complex stage on the right (with a larger gap.)

alt text

NO MATTER WHAT, the second frame always returns 0.2 for Time.time and the third frame always returns 0.3533334, and there is no way that can be right, right? So that is probably inaccurate? But why would Unity have inaccurate time for a few frames? Whatever the case, it creates a weird situation like the times on the image on the right below, where in frame 2 Time.time is returning 0.2 and my audio is returning 0, but at frame 3 Time.time has only changed by about 0.15, while my audio time has changed by over 1.0.

I didn't do exact calculations but it seems like after those first few frames it's more or less accurately syncing time.

This is just the worst example I could capture, but at times I've had it off by 2-3 seconds or more from the start.

So like, any insight into what is going on in those first few frames, and why time is being measured differently by my Time.time and audio time? A part of me wants to just start my audio and movement at frame 5 or something and see if that fixes it, but that feels so hacky and I want to actually understand what is going on here before trying to fix it. Because maybe the audio start is causing the problem or something so it wouldn't matter where I moved it. I dunno.

HELP!

unity-time-difference-issue.png (123.0 kB)
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

0 Replies

· Add your reply
  • Sort: 

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

119 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 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 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 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 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 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

How to make two audio tracks play in sync? 2 Answers

Problem using AudioSource.timeSamples 1 Answer

AudioSource and AudioSettings help needed to keep perfect sync between music audio loops. 0 Answers

How to smoothly fade audio without any pops? Source.volume is correct, but the sound itself seems to update inconsistently. 1 Answer

Audio not coming out of speakers 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