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
1
Question by GurtejKanwar · Jul 27, 2012 at 05:02 PM · androidaudiosoundstatic

Why does sound on Android play at double speed and crackle?

I'm trying to get some sound working in a Unity project at the moment. The sound works perfectly fine in the Editor and in the iOS build.

When building for Android, however, the music makes a crackling/popping/static noise, and plays twice as fast. I've checked audio.pitch and it's set to 1 (and anyway, the pitch of the audio is not different, it's just as if half of the "audio frames" are missing). This applies to all my sounds.

I've tried:

  • Changing the sound from 2D to 3D and back

  • Changing compression to native

  • Changing compression amount

  • Changing load type

  • Forcing the sound to mono

  • Changing the Audio settings default speaker set up to mono

  • Using AudioSource.PlayClipAtPoint instead of an AudioSource component

  • Changing pan level when the sound was a 3D sound

  • Checking bypass effects

  • Playing on awake vs. starting from script

  • Testing on multiple devices

The sound files definitely play correctly outside of Unity (and in the Editor and iOS). Native Android sound files play correctly on the phone.

I can't think of what else could cause this, especially the playing twice as fast.

For now, I'm going to make the background music file into a native Android sound (though that breaks the abstraction barrier) and leave the smaller sound effects as they are (they don't seem to be as bad).

EDIT: My project is actually used as a library inside a larger native Android project. I normally test by exporting, then running my shell project. I just tested by exporting the Unity project straight to my phone and the sound worked fine. It looks like somehow my native Android code is interfering with the Unity music. Does anybody know how the Unity sound system works in terms of Android? Any thoughts on how my code could be interfering with it? I'm using a MediaPlayer to play some sounds in the native Android shell also.

Comment
Add comment · Show 3
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 39thstreet · Aug 07, 2012 at 10:49 PM 0
Share

Having this same issue, but only on one of the two apps I'm working on. I can't deter$$anonymous$$e which setting is different.

avatar image wilco64256 · Aug 07, 2012 at 11:20 PM 0
Share

What file type are you using?

avatar image GurtejKanwar · Aug 07, 2012 at 11:26 PM 0
Share

39thstreet -- Glad to hear it isn't just me. Let me know if you figure anything out. wilco64256 -- I'm importing from mp3 format, but doesn't Unity import it into it's own format anyway? It previews correctly in Unity so that seems to suggest that the import works fine.

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by 39thstreet · Aug 08, 2012 at 01:34 PM

Here's how I ended up fixing it: Project settings > Audio > Default Speaker Mode to Stereo. When it's in mono, it caused the issue I was having.

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 GurtejKanwar · Aug 10, 2012 at 05:49 PM 0
Share

Thanks for the answer! I think I tried this already, but I'll test it out when I get the chance.

avatar image GurtejKanwar · Aug 13, 2012 at 09:47 PM 0
Share

I just checked my Audio settings and the speaker mode is already set to Stereo. I wonder if there's some other setting that overrides this somehow?

avatar image
0

Answer by Majkell · Apr 08, 2013 at 05:42 PM

I have been struggling with a same problem for few days and finally found the solution which worked for me, so I decided to share if someone stumbles upon this old thread.

You must not extend UnityPlayerActivity in Eclipse but plain Activity and sound issues are gone.

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 mirek.um · Nov 03, 2014 at 10:06 AM

Check audio sampling, if it's too high like 96KHz then sound can be distorted.

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

9 People are following this question.

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

Related Questions

Tracker modules on Android 0 Answers

Android plugin loading resources problem 1 Answer

2D game - how to optimize performance for audio when you do not need 3D audio? 1 Answer

OnAudioFilterRead issues on Android? 1 Answer

What would be the best audio file atributes for handheld device? 0 Answers


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