{"id":14960481,"url":"https://github.com/ivanmurzak/unity-audioloader","last_synced_at":"2026-04-02T02:36:50.133Z","repository":{"id":186583744,"uuid":"675371523","full_name":"IvanMurzak/Unity-AudioLoader","owner":"IvanMurzak","description":"Asynchronous audio loading from remote or local destination. It has two layers of configurable cache system: RAM and Disk.","archived":false,"fork":false,"pushed_at":"2024-01-22T20:10:53.000Z","size":2984,"stargazers_count":32,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-10T10:06:00.561Z","etag":null,"topics":["audio","unity","unity-plugin","unity-plugins","unity3d","unity3d-plugin"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IvanMurzak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-06T17:36:07.000Z","updated_at":"2024-07-29T10:29:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"b075d4d5-6566-477d-bf70-d3bfa3942184","html_url":"https://github.com/IvanMurzak/Unity-AudioLoader","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"1d3b35d31400a832d7962cc79ed95c838f377720"},"previous_names":["ivanmurzak/unity-audioloader"],"tags_count":5,"template":false,"template_full_name":"IvanMurzak/Unity-Package-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanMurzak%2FUnity-AudioLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanMurzak%2FUnity-AudioLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanMurzak%2FUnity-AudioLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanMurzak%2FUnity-AudioLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IvanMurzak","download_url":"https://codeload.github.com/IvanMurzak/Unity-AudioLoader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868117,"owners_count":16555878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","unity","unity-plugin","unity-plugins","unity3d","unity3d-plugin"],"created_at":"2024-09-24T13:22:22.061Z","updated_at":"2025-10-24T18:31:49.113Z","avatar_url":"https://github.com/IvanMurzak.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity Audio Loader\n\n![npm](https://img.shields.io/npm/v/extensions.unity.audioloader) [![openupm](https://img.shields.io/npm/v/extensions.unity.audioloader?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/extensions.unity.audioloader/) ![License](https://img.shields.io/github/license/IvanMurzak/Unity-AudioLoader) [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)\n\nAsync audio loader with two caching layers for Unity.\n\n![Image Loader](https://github.com/IvanMurzak/Unity-AudioLoader/blob/master/Header.jpg?raw=true)\n\n## Features\n\n- ✔️ Async loading from **Web** or **Local** `AudioLoader.LoadAudioClip(audioURL);`\n- ✔️ **Memory** and **Disk** caching - tries to load from memory first, then from disk\n- ✔️ Dedicated thread for disk operations\n- ✔️ Avoids loading same audio multiple times simultaneously, a task waits for completion the first and just returns loaded audio if at least one cache layer activated\n- ✔️ Auto set to AudioSource `AudioLoader.SetAudioSource(audioURL, audioSource);`\n- ✔️ Debug level for logging `AudioLoader.settings.debugLevel = DebugLevel.Error;`\n\n# Usage\n\nIn the main thread somewhere at the start of the project need to call `AudioLoader.Init();` once to initialize static properties in the right thread. It is required to be made in the main thread. Then you can use `AudioLoader` from any thread and at any time.\n\n## Sample - Loading audio file, set to AudioSource\n\n``` C#\nusing Extensions.Unity.AudioLoader;\nusing Cysharp.Threading.Tasks;\n\npublic class AudioLoaderSample : MonoBehaviour\n{\n    [SerializeField] string audioURL;\n    [SerializeField] AudioSource audioSource;\n\n    async void Start()\n    {\n        // Loading audio file from web, cached for quick load next time\n        audioSource.clip = await AudioLoader.LoadAudioClip(audioURL);\n\n        // Same loading with auto set to audio\n        await AudioLoader.SetAudioSource(audioURL, audioSource);\n    }\n}\n```\n\n## Sample - Loading audio into multiple Audio components\n\n``` C#\nusing Extensions.Unity.AudioLoader;\nusing Cysharp.Threading.Tasks;\n\npublic class AudioLoaderSample : MonoBehaviour\n{\n    [SerializeField] string audioURL;\n    [SerializeField] AudioSource audioSource1;\n    [SerializeField] AudioSource audioSource2;\n\n    void Start()\n    {\n        // Loading with auto set to audio\n        AudioLoader.SetAudioSource(audioURL, audioSource1, audioSource2).Forget();\n    }\n}\n```\n\n# Cache\n\nCache system based on the two layers. The first layer is **memory cache**, and the second is **disk cache**. Each layer could be enabled or disabled. It could be used without caching at all. By default, both layers are enabled.\n\n## Setup Cache\n\n- `AudioLoader.settings.useMemoryCache = true;` default value is `true`\n- `AudioLoader.settings.useDiskCache = true;` default value is `true`\n  \nChange disk cache folder:\n\n``` C#\nAudioLoader.settings.diskSaveLocation = Application.persistentDataPath + \"/myCustomFolder\";\n```\n\n## Override Cache\n\n``` C#\n// Override Memory cache for specific audio\nAudioLoader.SaveToMemoryCache(url, audioClip);\n\n// Take from Memory cache for specific audio file if exists\nAudioLoader.LoadFromMemoryCache(url);\n```\n\n## Does Cache contain audio\n\n``` C#\n// Check if any cache contains specific audio file\nAudioLoader.CacheContains(url);\n\n// Check if Memory cache contains specific audio file\nAudioLoader.MemoryCacheContains(url);\n\n// Check if Memory cache contains specific audio file\nAudioLoader.DiskCacheContains(url);\n```\n\n## Clear Cache\n\n``` C#\n// Clear memory Memory and Disk cache\nAudioLoader.ClearCache();\n\n// Clear only Memory cache for all audio files\nAudioLoader.ClearMemoryCache();\n\n// Clear only Memory cache for specific audio file\nAudioLoader.ClearMemoryCache(url);\n\n// Clear only Disk cache for all audio files\nAudioLoader.ClearDiskCache();\n\n// Clear only Disk cache for specific audio file\nAudioLoader.ClearDiskCache(url);\n```\n\n# Installation\n\n- [Install OpenUPM-CLI](https://github.com/openupm/openupm-cli#installation)\n- Open command line in Unity project folder\n- Run the command\n\n``` CLI\nopenupm add extensions.unity.audioloader\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanmurzak%2Funity-audioloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanmurzak%2Funity-audioloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanmurzak%2Funity-audioloader/lists"}