Noise or something similar to crackling on android devices

Hello everyone,
I have a super annoying problem. My project’s android builds have noise on the smartphones. This noise is always present, no matter if the volume of the smartphone is set to 100% or if it is completely turned off. Its loudness also does not depend on the volume of the smartphone, but if the game plays any sound, the noise increases its volume instead of the sound. This only affects smartphones (tested on 4 devices), there is no noise on emulators like LDPlayer or BlueStacks. I tried all the settings in “Audio” (Edit > Project Settings), the noise disappears only when “Disable Unity Audio” is enabled, which is logical. I tried different audio file formats, different types of compression, but this is not the problem, because there is noise even when there is not a single sound in the project. Engine versions: 2020.2.1f1 / 2020.3.23f1 LTS

I can’t find any solution for a couple of months now, it’s very annoying. What is it? How to fix it?

similar topics from while ago, if can try those

I have read these branches and tried to change dspBufferSize with the script and through the audio settings - this does not work

Okay. I read the existing threads on the forum and the unity bug tracker, it says about changing dspBufferSize, but in my case it did not solve the problem. It turned out that on the android devices that I tested the noise from the speakers disappear when you plug in a headphones. I decided to check the games of other developers and downloaded a random game from the market made in unity, but the game was not of the best quality, if you know what I mean, there is also the same problem. I remembered “Monument Valley” game which was released in 2014 and it has exactly the same problem, noise from the speakers. On the iPhone everything is fine. Only on android. How so? A problem that has existed for more than 7 years. What is wrong with android builds? What’s wrong with unity? What is the cause of this noise? I want to see an answer from unity’s technical specialist on how to fix it, but if it’s a bug, how soon will it be fixed?

My guess would be a sample rate mismatch.

Are you using multiple layers of effects in the audio mixer?
I’ve seen many cases of audio crackling that were only due to intense audio processing. It might not be that you have too many effects, some native audio plugins can sometime have an exponential cost bound to a single parameter.

I have the same issue at least for some clips. I also tried changing AudioConfiguraiton.dspBufferSize and sampleRate, but without success. I’m not using any audio mixer groups and it even happens when there’s only one single AudioSource in the scene. Apparently the noise and crackling only affect some clips and others play out well, but I couldn’t figure out a pattern so far. Still it works once you use headphones, tested it on several devices. Any more ideas on this topic?

I’d be curious to know what is the format of the files working and the format of those that don’t (mp3? ogg? sampling rate? compression setting? etc…)

Generally plugging headphones would trigger an audio engine reset (sorry) so maybe there is something wrong with AudioSettings initially. Are you tweaking these settings at runtime?

Thanks for your answer!

On of the clips not working is a mp3 file, but I already tried converting it to a wav and ogg but the result was the same for both. The sampling rate of the file is 48000 Hz, I added a screenshot of the import settings. There is no Android override. I already tried several settings here but without any success, but frankly at this point it don’t really know what I’m doing so it was mainly trail and error.

Here’s a link to the original mp3 file.When looping the file in an Android build you will hear a background noise and a crackling noise at the end of each loop. This is what it’s supposed to sound like when it’s looped. And this is what it sounds like on Android. You can cleary hear the noise and the cracking. Note that both files were recorded during the same session with the noisy record having used the devices microphone (so what you actually here) and the other one having used the phone’s internal sound output of the app for recording.

9431075--1322264--settings.PNG

Here are the audio settings. I used to change them on runtime for debugging purposes but not in the current builds. The AudioConfigurations sampleRate is 48000 and the dspBufferSize is 1024, changing them on runtime did not fix the issue so far. Btw for this project the Unity Version is 2021.3.11f1.

9431075--1322270--audio settings.PNG

I have a similar issue, as reported here:

However, only my Pixel 8 Pro on Android 14 is affected. Two other devices work just fine.

@Pommesbruder
Just to be clear, is the “broken” sound is the result of looping the original sound or is it another sound and the weird part is just the noise/crackling?

Also to clarify: how did you gather the broken sound? Is it playing this way in the editor when you switched to the Android platform in Project Settings or is this directly from an Android device? Also bonus, what is the device and Android version you’re using?

I see nothing wrong with your settings, but it could be interesting to check if this still happens with different compression/loading/normalization strategies.

@SeventhString
It’s all the same sound and what you hear is it being looped.

It was played directly from the Android device. It’s a Samsung Galaxy M30 using Android 11, but I also tested it on another Samsung device.

Anyway, turns out that apparently the problem is the phone and not Unity, since opening the link I posted before to play the sound on the device results in the same noise and cracking. Still weird, but I guess exchanging the affected sound files it is then :confused:

In my case, the sound is not looped, and the problem only appears on device. It also depends on the device type. It’s worst on my brand-new Google Pixel 8 Pro. After changing the audio buffer size to 64, the sounds play fine. But that’s a pretty weird workaround, if you ask me.

Also, the sound is not really “crackling” in my case, it’s completely distorted, with some of the audio being delayed weirdly. Unbareable user experience.

Just in case anyone knows more about sounds on Android and is motivated to find out more about this problem: besides this file I linked above, theses files from freesound.org are also not working properly:

Heavy Stone Push
Blip (SFX)

To me it looks like maybe this problem only occurs for bass heavy sounds since they all are.

Nope, my soudns are not bass heavy, and they sound completely distorted.

I believe I finally found a solution for this issue, for everyone who comes across it in the future.

I had the same problem in 2025 — this horrible screeching/distorted crackling sound on certain Android devices. All the symptoms matched this thread and several others I found across the forum.

I tried everything: reducing sound quality, limiting FPS, exporting audio in different formats… nothing helped.

I also noticed, just like other people mentioned, that the issue only happens on some Android devices and not others, and also that sometimes it happens only with specific music tracks, not all of them.

During development I never had this issue when testing on PC — of course. Then I tested the app on a Galaxy S23 FE — also no issue.

But later I tested on a Galaxy A35, which has a relatively weak processor, so I immediately suspected it might be related to hardware performance. After trying all the suggestions I found in the forums (unsuccessfully), I decided to try something else.

The first thing I did was hide all 3D objects and scripts in the scene, leaving only the audio playing. Immediately, the crackling was completely gone.

Then I started adding objects back into the scene, and the crackling returned — mildly at first, then more and more as I added more objects. This confirmed it was definitely a performance-related issue. After reading more, I understood that this is caused by too much load on the main thread. Some of my scenes were perfectly fine — the ones that didn’t have many models to render — and the audio had zero issues. (I specifically copied the same background music into those scenes for testing.)

Final conclusion: weaker phones with weaker hardware were causing the crackling, and nothing I did inside Unity’s audio system solved it.

So the workaround turned out to be very simple:
Instead of using Unity’s AudioSource on Android, I bypassed it completely and used the Android native media player for background music. This works perfectly.

There are plugins that do this, but I wrote my own script (with help from my friend GPT) that invokes Java through C#, plays background music, handles pause/resume when the app is minimized, and can be reused across different scenes by loading a track by filename. You just need to place your audio files in the Assets/StreamingAssets folder.

This solution works great for background music, but the native media player can only handle one track at a time. So I wrote another script that uses the Android native SoundPool for sound effects and narration. This also works perfectly. And of course, you can add an if/else in your code to use the normal Unity AudioSource when running in the Editor or on iOS.

Hope this helps. Posting the code now :slight_smile:

NativeAudio: just add to an empty game object and pass musicfilename.mp3

using UnityEngine;
using System.Collections;

public class AndroidBGMPlayer : MonoBehaviour
{
    [Header("Music Filename in StreamingAssets (e.g., bgm_forest.mp3)")]
    public string musicFileName = "bgm_default.mp3";

    private AndroidJavaObject mediaPlayer;
    private bool isPrepared = false;

    void Start()
    {
        if (Application.platform == RuntimePlatform.Android)
            StartCoroutine(InitAndPlay(musicFileName));
    }

    IEnumerator InitAndPlay(string fileName)
    {
        yield return new WaitForSeconds(1f); // Optional delay before playing

        using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
        {
            AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
            AndroidJavaObject context = activity.Call<AndroidJavaObject>("getApplicationContext");

            AndroidJavaObject assetManager = context.Call<AndroidJavaObject>("getAssets");
            AndroidJavaObject afd = assetManager.Call<AndroidJavaObject>("openFd", fileName);

            mediaPlayer = new AndroidJavaObject("android.media.MediaPlayer");
            mediaPlayer.Call("setDataSource",
                afd.Call<AndroidJavaObject>("getFileDescriptor"),
                afd.Call<long>("getStartOffset"),
                afd.Call<long>("getLength"));

            mediaPlayer.Call("setLooping", true);
            mediaPlayer.Call("prepare");
            mediaPlayer.Call("start");
            isPrepared = true;
        }
    }

    public void Stop()
    {
        if (mediaPlayer != null && isPrepared)
        {
            mediaPlayer.Call("stop");
            mediaPlayer.Call("release");
            mediaPlayer.Dispose();
            mediaPlayer = null;
        }
    }

    void OnApplicationPause(bool pause)
    {
        if (mediaPlayer == null) return;
        if (pause) mediaPlayer.Call("pause");
        else mediaPlayer.Call("start");
    }

    void OnDestroy()
    {
        Stop();
    }
}

SoundPool: Just add to an empty game object, add a selector and filename:

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;

public class AndroidSoundPoolManager : MonoBehaviour
{
    public static AndroidSoundPoolManager Instance;

    private AndroidJavaObject soundPool;
    private Dictionary<string, int> soundIds = new Dictionary<string, int>();
    private List<int> playingStreamIds = new List<int>();
    private AndroidJavaObject context;
    private bool isReady = false;

    [System.Serializable]
    public class SoundEntry
    {
        public string key;
        public string fileName;
    }

    [Header("Sound Files")]
    public SoundEntry[] soundEntries;

    public bool IsReady() => isReady;

    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
#if UNITY_ANDROID && !UNITY_EDITOR
            StartCoroutine(InitSoundPoolAsync());
#else
            Debug.Log("🧪 SoundPool only works on Android builds.");
#endif
        }
        else
        {
            Destroy(gameObject);
        }
    }

#if UNITY_ANDROID && !UNITY_EDITOR
    private IEnumerator InitSoundPoolAsync()
    {
        using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
        {
            context = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity")
                                 .Call<AndroidJavaObject>("getApplicationContext");
        }

        soundPool = new AndroidJavaObject("android.media.SoundPool", 10, 3, 0);

        foreach (var entry in soundEntries)
        {
            string sourcePath = Path.Combine(Application.streamingAssetsPath, entry.fileName);
            string destPath = Path.Combine(Application.persistentDataPath, entry.fileName);

            if (!File.Exists(destPath))
            {
                UnityWebRequest www = UnityWebRequest.Get(sourcePath);
                yield return www.SendWebRequest();

                if (www.result == UnityWebRequest.Result.Success)
                {
                    File.WriteAllBytes(destPath, www.downloadHandler.data);
                    Debug.Log($"✅ Copied: {entry.key} to {destPath}");
                }
                else
                {
                    Debug.LogError($"❌ Failed to copy {entry.fileName}: {www.error}");
                    continue;
                }
            }

            int soundId = soundPool.Call<int>("load", destPath, 1);
            soundIds[entry.key] = soundId;
            Debug.Log($"🎵 Loaded sound: {entry.key} → ID: {soundId}");
        }

        isReady = true;
    }
#endif

    public void PlaySound(string key, float volume = 1f)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        if (!isReady)
        {
            Debug.LogWarning("🚫 SoundPool not ready yet.");
            return;
        }

        if (soundIds.TryGetValue(key, out int id))
        {
            int streamId = soundPool.Call<int>("play", id, volume, volume, 1, 0, 1f);
            if (streamId > 0)
            {
                playingStreamIds.Add(streamId);
            }
        }
        else
        {
            Debug.LogWarning($"🚫 Sound key not found: '{key}'");
        }
#else
        Debug.Log($"🔊 [Editor] Would play sound: {key}");
#endif
    }

    private void OnApplicationPause(bool pause)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        if (!isReady || soundPool == null) return;

        if (pause)
        {
            // Pause all playing streams
            foreach (int streamId in playingStreamIds)
            {
                soundPool.Call("pause", streamId);
            }
            Debug.Log("⏸️ Paused all SoundPool streams");
        }
        else
        {
            // Resume all previously playing streams
            foreach (int streamId in playingStreamIds)
            {
                soundPool.Call("resume", streamId);
            }
            Debug.Log("▶️ Resumed all SoundPool streams");
        }
#endif
    }
}

Invoke from anywhere in your code:

    private IEnumerator Start()
    {
#if UNITY_ANDROID && !UNITY_EDITOR
    // Wait until SoundPool is initialized before playing
    yield return new WaitUntil(() => AndroidSoundPoolManager.Instance != null && AndroidSoundPoolManager.Instance.IsReady());

    AndroidSoundPoolManager.Instance.PlaySound("paintIntro");
#else
        yield return null;
#endif
    }

Good question! Let me look into that over the next few days and I’ll update my response :slightly_smiling_face:.

I also added another script that can invoke multiple media players simultaneously, and I’ll be posting that one as well.

This is because the MediaPool can only handle short files for sound effects, and I also had longer narrations that needed to play simultaneously with background music and sound effects.