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 seejayjames · Jun 05, 2014 at 07:04 PM · androidframe rateaudio.playoneshot

Audio distortion and dropping out on Android

Had an issue with this for awhile and nearly tore my hair out, but finally got it resolved (mostly). I do have a few questions after the explanation though.

I have a bunch of prefabs with AudioSources playing short clips at specific intervals (strictly frame-based triggering using counters and Audio.PlayOneShot). Worked great in the Editor and PC Standalone. On Android the sounds would play distorted (not like digital clipping, was different), and often would drop out halfway through. The strange thing is that I have a different project using the same sounds, and never had any issue, even playing multiple ones at once. I tried everything I could think of from reading multiple threads about this, like Audio Settings tweaking, clips compressed/raw, convert to mono, etc...nothing seemed to work.

So...what was the magic fix?? I set

Application.targetFrameRate = 60;

At 30 it was causing the issues. Strange, I thought increasing the frame rate would make a problem like this WORSE, not better! But maybe the increased frame rate somehow allows the audio to happen...better? Can anyone shed some light on that?

Also, is it helpful in this case to tweak the DSPBuffer Size, and if so, what should it be set at? For this project I need accurate timing, which would be lowest latency, I suppose...but if it comes at the expense of distorted sounds, then...well, you get the picture (hair being torn out of an already-thinning head)...

Anyway, hope that helps someone down the road...it almost made me abandon the project, except I knew it had worked in the earlier project, so I kept at it...and so far, so good at the higher frame rate. But if anyone has words of wisdom about this, I would love to hear them. Thanks!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by seejayjames · Jun 06, 2014 at 03:29 AM

Update: On that same device, later, the 60 FPS started crackling too. Not nearly as bad, I don't think it will be usable. Will try on other devices (Android phone and iOS) and see if anything changes...

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 gvexplorer · Jul 31, 2014 at 05:33 PM

Hi, I do not have an answer. However I do have a similar problem. As an interesting experiment to see if this is in fact the same issue, on different android devices (i.e. this is not a silly hardware issue) I noticed when using headphones, the sound is perfect. When listening on speaker, on multiple different handsets, the sound crackles the way you describe. If you do not mind, and I know it sounds crazy, could you please try and listen on earphones and see if the same is true for you? I wonder whether when you thought frame settings fixed the issue, you perhaps were listening over earphones, and yes I really would love to know how to fix this issue. .... BTW I have resolved my issue, it was down to how I recorded the sound in the first place in audacity. Using 1 input channel rather than recording in 2 input channel mode meant the sound works fine on android as well now. Hope this helps you...

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

22 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

Related Questions

Application.targetFrameRate odd results on some phones 0 Answers

App plays well on Android phones but really slow on an Android tablet. 2 Answers

How do i acces files on mobile platforms? 0 Answers

Device acceleration problem 0 Answers

Missing android license? Help! 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