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
2
Question by Jason B · Jan 29, 2011 at 06:49 PM · audioimportsoundloopcutoff

Unity keeps altering my audio asset on import...?

When I import my sound loop (of the sound a ball makes when it rolls on a hard surface) into Unity, Unity adds about 1/5th of a second of silence at the beginning of the sound and maybe 1/10th of a second of silence at the end. That in itself seems totally random to me.

In my audio editor, there is no such silence visible (or audible) in the waveform. It is a perfect loop. However, in the waveform shown in the Unity inspector, you can see the short silence at the beginning and shorter silence at the end. And of course, you can hear the silence when it plays. I thought maybe Unity was using some kind of cached earlier and messed up version of the sound file and wasn't reimporting properly, but even when I import it as different file names it doesn't change matters at all.

Has anyone ever had this little issue before?

I've "fixed" it by attaching a script that basically says "if the time of the sound is less than 0.1 second, go straight to 0.1 second, and if it's higher than the duration minus 0.1 second, go to 0.1 second". Works great, but that's really just hiding the symptoms, not curing the problem.

Is there some sort of file format that Unity doesn't like for sound loops? The loop is in MP3 format, and is a pretty crappy bit rate (Think in the neigborhood of ~50kbps) because the source unfortunately had to be recorded that way, but I don't see how that would have anything to do with it.

My script fixes the problem, but I'd like a real fix if one exists just because it bugs me to have to remember to apply a script to every single loop. :(

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

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by marklin · Dec 15, 2016 at 03:36 PM

I think the correct solution is to use WAV audio files (instead of MP3 in my case). Using WAV, Unity won't add that annoying silence. If you're concerned about WAV file size (as these files are not compressed like MP3), don't worry because Unity will compress them. For example, a small sound as WAV is 383KB in size but Unity compresses it down to just 18.2KB.

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
avatar image
0

Answer by NotIWhoLive · Jun 13, 2011 at 03:58 PM

I'm having this problem too. Did you ever figure out the answer?

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
avatar image
0

Answer by GurtejKanwar · Jul 27, 2012 at 05:03 PM

Do you have Gapless Looping enabled? Gapless looping fills in silence to make the sound fit to the nearest "audio frame" I believe.

See this forum post for something similar to your issue -- http://forum.unity3d.com/threads/66090-Gapless-MP3-playback.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Why Doesn't My Music Loop? 5 Answers

Is there a way to create a random Audiosource loop? 2 Answers

How do I import audio and what type of audio do i need (mp3, etc.) 1 Answer

Can't get a sound to loop 2 Answers

VERY irritating.... I need help with playing and switching sounds in Javascript code... 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